velbus-aio 2024.4.1__py3-none-any.whl → 2024.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of velbus-aio might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: velbus-aio
3
- Version: 2024.4.1
3
+ Version: 2024.5.1
4
4
  Summary: Open-source home automation platform running on Python 3.
5
5
  Author-email: Maikel Punie <maikel.punie@gmail.com>
6
6
  License: MIT
@@ -26,7 +26,7 @@ Requires-Python: >=3.8.0
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: pyserial >=3.5.0
29
- Requires-Dist: pyserial-asyncio >=0.5
29
+ Requires-Dist: pyserial-asyncio-fast >=0.11
30
30
  Requires-Dist: backoff >=1.10.0
31
31
 
32
32
  ![CI](https://github.com/Cereal2nd/velbus-aio/actions/workflows/main.yml/badge.svg)
@@ -1,14 +1,14 @@
1
1
  velbusaio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- velbusaio/channels.py,sha256=v7hZoT7X3-fNBAvTKgVpxCY33HhUC9Ga4XTCMqJ3dTA,22799
2
+ velbusaio/channels.py,sha256=1fqxsNHmJmb6lYRr4UqP9HLeTprbvektzrjQ8QBvWi0,22889
3
3
  velbusaio/command_registry.py,sha256=j9KuLmada41PMEdtfPvLmXVOAZOkBM9zi-3kluwYffk,5140
4
4
  velbusaio/const.py,sha256=aysTlQcpACZaDVqoXAjWmaEDGlCB7KT04Rv-SAusPFc,1575
5
- velbusaio/controller.py,sha256=O9BAOFTb3GjTRX8EOrkIifqWN9GIp9Pm4x6__m5wa7A,8756
5
+ velbusaio/controller.py,sha256=txOd0JuYi_OGMzO1t2u7KXlF085HWa1HVlszz7A2O5c,8846
6
6
  velbusaio/discovery.py,sha256=Px6qoZl4QhF17aMz6JxstCORBpLzZGWEK9h4Vyvg57o,1649
7
7
  velbusaio/exceptions.py,sha256=FHkXaM3dK5Gkk-QGAf9dLE3FPlCU2FRZWUyY-4KRNnA,515
8
8
  velbusaio/handler.py,sha256=jTWIV26ibAqs3rcTku81NIHlPUeyWjStSih1Nfx-an0,5946
9
9
  velbusaio/helpers.py,sha256=iqpoereRH4JY5WAkozIqWvXWyRmhko-J-UGXDylFyEM,2537
10
10
  velbusaio/message.py,sha256=gnhXpA5NAG4qnI9vlxwlWQKETWneDb1lp0P9w_-nxhQ,5020
11
- velbusaio/module.py,sha256=sHOnGjuV--_aw83yh_Gx5CiRPDOBRr1PemVg5z5YYoQ,35467
11
+ velbusaio/module.py,sha256=_yFxZIi71eqq9xxNal-9ATNHGMjZDOr-dcpKYIxa7_8,35458
12
12
  velbusaio/protocol.json,sha256=7PifRZXctU5zSsodDGsUAhnnSsGNlcGcim1gr2su720,250396
13
13
  velbusaio/protocol.py,sha256=ofDwJfwyrVQDQ40WX2QdH1nTK-y2HibQPTo5dFY7SkQ,8224
14
14
  velbusaio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -69,7 +69,7 @@ velbusaio/messages/sensor_temp_request.py,sha256=bTChj9udOjIww9vJ2SWmMtbry_8jLDv
69
69
  velbusaio/messages/sensor_temperature.py,sha256=ThA_4FFhQutCSt8147yCy7ocUFfizWaUV2JHoNzesNc,1558
70
70
  velbusaio/messages/set_date.py,sha256=jcWb8c5mB71HNBwLCQ9ocEPSHQdZP0yfGJL4_swsRWQ,1359
71
71
  velbusaio/messages/set_daylight_saving.py,sha256=CpoKrSt62UzzNxl8SDcpDcb0GKnLcD1f73-ULzqDEzU,1049
72
- velbusaio/messages/set_dimmer.py,sha256=f2XWLbxoo0Tbj8_DUu28XSiib32VLUDtw8QRzRZBDdA,1975
72
+ velbusaio/messages/set_dimmer.py,sha256=b32lBHrvZRQ7kKIFhQwuBqk9rXagnBtcJxo1V7V5x_0,2050
73
73
  velbusaio/messages/set_led.py,sha256=X8tIDzJgtf5EsH92rjoUyrECNFW-ECgAQoQ9TnvJEQk,900
74
74
  velbusaio/messages/set_realtime_clock.py,sha256=h34pCvyPm7tSQ5BdB8yC8SRulrtldeX-ZJFv3Wcvdk0,1209
75
75
  velbusaio/messages/set_temperature.py,sha256=78LfGOBZo2bw7eF38uyXOjUcJrsSvQPDW2qbXLOYd0o,959
@@ -96,8 +96,8 @@ velbusaio/messages/very_fast_blinking_led.py,sha256=vlMEern8PoOvtO5JaAk9erMR4IKJ
96
96
  velbusaio/messages/write_data_to_memory.py,sha256=gr6bi4SzK8Mw8fnp8yV-STq5jts7NoeV7zZgdptH5Vs,1039
97
97
  velbusaio/messages/write_memory_block.py,sha256=zGnNxx_M66HpBQ8S7kagtNw8_qSRHsOLk1MuiS0uygM,1032
98
98
  velbusaio/messages/write_module_address_and_serial_number.py,sha256=6y57j-md3btNtQddX5CUREtSs1Dzgkd953sQPZ3Pioo,1597
99
- velbus_aio-2024.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
100
- velbus_aio-2024.4.1.dist-info/METADATA,sha256=gQoruLEsogCEK-x7B7ls4F_zLud9p4LJDDiPv2rreJ8,3253
101
- velbus_aio-2024.4.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
102
- velbus_aio-2024.4.1.dist-info/top_level.txt,sha256=W0-lSOwD23mm8FqaIe9vY20fKicBMIdUVjF-zmfxRnY,15
103
- velbus_aio-2024.4.1.dist-info/RECORD,,
99
+ velbus_aio-2024.5.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
100
+ velbus_aio-2024.5.1.dist-info/METADATA,sha256=z1Q-cGFQfsDQYGHAppFwXJUDplFi6qaFKIGJW0Me3c4,3259
101
+ velbus_aio-2024.5.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
102
+ velbus_aio-2024.5.1.dist-info/top_level.txt,sha256=W0-lSOwD23mm8FqaIe9vY20fKicBMIdUVjF-zmfxRnY,15
103
+ velbus_aio-2024.5.1.dist-info/RECORD,,
velbusaio/channels.py CHANGED
@@ -137,7 +137,10 @@ class Channel:
137
137
  }
138
138
 
139
139
  def to_cache(self) -> dict:
140
- return {"name": self._name, "type": type(self).__name__}
140
+ dst = {"name": self._name, "type": type(self).__name__}
141
+ if hasattr(self, "_Unit"):
142
+ dst["Unit"] = self._Unit
143
+ return dst
141
144
 
142
145
  def __setstate__(self, state):
143
146
  self.__dict__.update(state)
velbusaio/controller.py CHANGED
@@ -11,7 +11,7 @@ import time
11
11
  from urllib.parse import urlparse
12
12
 
13
13
  import serial
14
- import serial_asyncio
14
+ import serial_asyncio_fast
15
15
 
16
16
  from velbusaio.channels import Channel
17
17
  from velbusaio.const import LOAD_TIMEOUT
@@ -159,16 +159,18 @@ class Velbus:
159
159
  else:
160
160
  # serial port
161
161
  try:
162
- _transport, _protocol = await serial_asyncio.create_serial_connection(
163
- asyncio.get_event_loop(),
164
- lambda: self._protocol,
165
- url=self._dsn,
166
- baudrate=38400,
167
- bytesize=serial.EIGHTBITS,
168
- parity=serial.PARITY_NONE,
169
- stopbits=serial.STOPBITS_ONE,
170
- xonxoff=0,
171
- rtscts=1,
162
+ _transport, _protocol = (
163
+ await serial_asyncio_fast.create_serial_connection(
164
+ asyncio.get_event_loop(),
165
+ lambda: self._protocol,
166
+ url=self._dsn,
167
+ baudrate=38400,
168
+ bytesize=serial.EIGHTBITS,
169
+ parity=serial.PARITY_NONE,
170
+ stopbits=serial.STOPBITS_ONE,
171
+ xonxoff=0,
172
+ rtscts=1,
173
+ )
172
174
  )
173
175
  except (FileNotFoundError, serial.SerialException) as err:
174
176
  raise VelbusConnectionFailed from err
@@ -1,5 +1,4 @@
1
- """
2
- :author: Frank van Breugel
1
+ """:author: Frank van Breugel
3
2
  """
4
3
 
5
4
  from __future__ import annotations
@@ -12,10 +11,10 @@ COMMAND_CODE = 0x07
12
11
 
13
12
  @register(
14
13
  COMMAND_CODE,
15
- ["VMB1DM", "VMBDME", "VMB4DC", "VMBDMI", "VMBDMI-R", "VMB1LED", "VMB8DC-20"],
14
+ ["VMB1DM", "VMBDME", "VMB4DC", "VMB1LED"],
16
15
  )
17
16
  class SetDimmerMessage(Message):
18
- """
17
+ """with this message the channel numbering is a bitnumber
19
18
  send by:
20
19
  received by: VMBDME, VMB4DC
21
20
  """
@@ -34,9 +33,7 @@ class SetDimmerMessage(Message):
34
33
  self.set_no_rtr()
35
34
 
36
35
  def populate(self, priority, address, rtr, data):
37
- """
38
- :return: None
39
- """
36
+ """:return: None"""
40
37
  self.needs_high_priority(priority)
41
38
  self.needs_no_rtr(rtr)
42
39
  self.needs_data(data, 4)
@@ -48,9 +45,7 @@ class SetDimmerMessage(Message):
48
45
  )
49
46
 
50
47
  def data_to_binary(self):
51
- """
52
- :return: bytes
53
- """
48
+ """:return: bytes"""
54
49
  return bytes(
55
50
  [
56
51
  COMMAND_CODE,
@@ -60,9 +55,9 @@ class SetDimmerMessage(Message):
60
55
  ) + self.dimmer_transitiontime.to_bytes(2, byteorder="big", signed=False)
61
56
 
62
57
 
63
- @register(COMMAND_CODE, ["VMBDALI", "VMBDALI-20"])
58
+ @register(COMMAND_CODE, ["VMBDALI", "VMBDALI-20", "VMBDMI", "VMBDMI-R", "VMB8DC-20"])
64
59
  class SetDimmerMessage2(SetDimmerMessage):
65
- """
60
+ """This with this message the channel numbering is an integer
66
61
  send by:
67
62
  received by: VMBDALI
68
63
  """
velbusaio/module.py CHANGED
@@ -548,7 +548,7 @@ class Module:
548
548
  except OSError:
549
549
  cache = {}
550
550
  # load default channels
551
- await self.__load_default_channels()
551
+ await self._load_default_channels()
552
552
  # load the data from memory ( the stuff that we need)
553
553
  if "name" in cache and cache["name"] != "":
554
554
  self._name = cache["name"]
@@ -560,6 +560,8 @@ class Module:
560
560
  if "channels" in cache:
561
561
  for num, chan in cache["channels"].items():
562
562
  self._channels[int(num)]._name = chan["name"]
563
+ if "Unit" in chan:
564
+ self._channels[int(num)]._Unit = chan["Unit"]
563
565
  self._channels[int(num)]._is_loaded = True
564
566
  else:
565
567
  await self._request_channel_name()
@@ -726,7 +728,7 @@ class Module:
726
728
  msg.low_address = addr[1]
727
729
  await self._writer(msg)
728
730
 
729
- async def __load_default_channels(self) -> None:
731
+ async def _load_default_channels(self) -> None:
730
732
  if "Channels" not in self._data:
731
733
  return
732
734
 
@@ -774,19 +776,15 @@ class VmbDali(Module):
774
776
  )
775
777
  self.group_members: dict[int, set[int]] = {}
776
778
 
777
- async def load(self, from_cache: bool = False) -> None:
778
- await super().load(from_cache)
779
-
780
- if not from_cache:
781
- for chan in range(1, 64 + 1):
782
- self._channels[chan] = Channel(
783
- self, chan, "placeholder", True, self._writer, self._address
784
- )
785
- # Placeholders will keep this module loading
786
- # Until the DaliDeviceSettings messages either delete or replace these placeholder's
787
- # with actual channels
788
-
789
- await self._request_dali_channels()
779
+ async def _load_default_channels(self) -> None:
780
+ for chan in range(1, 64 + 1):
781
+ self._channels[chan] = Channel(
782
+ self, chan, "placeholder", True, self._writer, self._address
783
+ )
784
+ # Placeholders will keep this module loading
785
+ # Until the DaliDeviceSettings messages either delete or replace these placeholder's
786
+ # with actual channels
787
+ await self._request_dali_channels()
790
788
 
791
789
  async def _request_dali_channels(self):
792
790
  msg_type = commandRegistry.get_command(