velbus-aio 2022.12.0__tar.gz → 2023.5.0__tar.gz

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.

Files changed (114) hide show
  1. {velbus-aio-2022.12.0/velbus_aio.egg-info → velbus-aio-2023.5.0}/PKG-INFO +6 -6
  2. velbus-aio-2023.5.0/pyproject.toml +68 -0
  3. velbus-aio-2023.5.0/setup.cfg +4 -0
  4. velbus-aio-2023.5.0/setup.py +3 -0
  5. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0/velbus_aio.egg-info}/PKG-INFO +6 -6
  6. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbus_aio.egg-info/SOURCES.txt +3 -1
  7. velbus-aio-2023.5.0/velbus_aio.egg-info/not-zip-safe +1 -0
  8. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbus_aio.egg-info/top_level.txt +1 -0
  9. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/channels.py +39 -3
  10. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/handler.py +1 -1
  11. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/__init__.py +1 -0
  12. velbus-aio-2023.5.0/velbusaio/messages/edge_set_color.py +113 -0
  13. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/edge_set_custom_color.py +2 -2
  14. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/restore_dimmer.py +2 -1
  15. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_dimmer.py +2 -1
  16. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/module.py +6 -2
  17. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/raw_message.py +4 -4
  18. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/util.py +8 -5
  19. velbus-aio-2022.12.0/setup.cfg +0 -27
  20. velbus-aio-2022.12.0/setup.py +0 -22
  21. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/LICENSE +0 -0
  22. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/MANIFEST.in +0 -0
  23. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/README.md +0 -0
  24. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/requirements.txt +0 -0
  25. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbus_aio.egg-info/dependency_links.txt +0 -0
  26. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbus_aio.egg-info/requires.txt +0 -0
  27. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/__init__.py +0 -0
  28. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/command_registry.py +0 -0
  29. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/const.py +0 -0
  30. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/controller.py +0 -0
  31. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/discovery.py +0 -0
  32. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/exceptions.py +0 -0
  33. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/helpers.py +0 -0
  34. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/message.py +0 -0
  35. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/blind_status.py +0 -0
  36. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/bus_active.py +0 -0
  37. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/bus_error_counter_status.py +0 -0
  38. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/bus_error_counter_status_request.py +0 -0
  39. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/bus_off.py +0 -0
  40. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/channel_name_part1.py +0 -0
  41. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/channel_name_part2.py +0 -0
  42. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/channel_name_part3.py +0 -0
  43. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/channel_name_request.py +0 -0
  44. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/clear_led.py +0 -0
  45. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/counter_status.py +0 -0
  46. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/counter_status_request.py +0 -0
  47. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/cover_down.py +0 -0
  48. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/cover_off.py +0 -0
  49. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/cover_position.py +0 -0
  50. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/cover_up.py +0 -0
  51. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/dali_device_settings.py +0 -0
  52. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/dali_device_settings_request.py +0 -0
  53. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/dali_dim_value_status.py +0 -0
  54. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/dimmer_channel_status.py +0 -0
  55. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/dimmer_status.py +0 -0
  56. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/fast_blinking_led.py +0 -0
  57. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/forced_off.py +0 -0
  58. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/forced_on.py +0 -0
  59. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/interface_status_request.py +0 -0
  60. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/ir_receiver_status.py +0 -0
  61. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/kwh_status.py +0 -0
  62. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/light_value_request.py +0 -0
  63. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/memo_text.py +0 -0
  64. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/memory_data.py +0 -0
  65. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/memory_data_block.py +0 -0
  66. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/memory_dump_request.py +0 -0
  67. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/meteo_raw.py +0 -0
  68. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/module_status.py +0 -0
  69. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/module_status_request.py +0 -0
  70. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/module_subtype.py +0 -0
  71. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/module_type.py +0 -0
  72. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/module_type_request.py +0 -0
  73. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/push_button_status.py +0 -0
  74. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/read_data_block_from_memory.py +0 -0
  75. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/read_data_from_memory.py +0 -0
  76. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/realtime_clock_status_request.py +0 -0
  77. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/receive_buffer_full.py +0 -0
  78. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/receive_ready.py +0 -0
  79. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/relay_status.py +0 -0
  80. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/select_program.py +0 -0
  81. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/sensor_settings_request.py +0 -0
  82. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/sensor_temp_request.py +0 -0
  83. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/sensor_temperature.py +0 -0
  84. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_date.py +0 -0
  85. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_daylight_saving.py +0 -0
  86. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_led.py +0 -0
  87. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_realtime_clock.py +0 -0
  88. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/set_temperature.py +0 -0
  89. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/slider_status.py +0 -0
  90. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/slow_blinking_led.py +0 -0
  91. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/start_relay_blinking_timer.py +0 -0
  92. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/start_relay_timer.py +0 -0
  93. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_relay_off.py +0 -0
  94. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_relay_on.py +0 -0
  95. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_to_comfort.py +0 -0
  96. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_to_day.py +0 -0
  97. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_to_night.py +0 -0
  98. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/switch_to_safe.py +0 -0
  99. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_settings_part1.py +0 -0
  100. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_settings_part2.py +0 -0
  101. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_settings_part3.py +0 -0
  102. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_settings_part4.py +0 -0
  103. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_settings_request.py +0 -0
  104. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_sensor_status.py +0 -0
  105. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_set_cooling.py +0 -0
  106. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/temp_set_heating.py +0 -0
  107. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/update_led_status.py +0 -0
  108. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/very_fast_blinking_led.py +0 -0
  109. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/write_data_to_memory.py +0 -0
  110. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/write_memory_block.py +0 -0
  111. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/messages/write_module_address_and_serial_number.py +0 -0
  112. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/moduleprotocol/protocol.json +0 -0
  113. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/protocol.py +0 -0
  114. {velbus-aio-2022.12.0 → velbus-aio-2023.5.0}/velbusaio/py.typed +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: velbus-aio
3
- Version: 2022.12.0
4
- Summary: Python Library for the Velbus protocol based on asyncio
5
- Home-page: https://github.com/Cereal2nd/velbus-aio
6
- Author: Maikel Punie
7
- Author-email: maikel.punie@gmail.com
3
+ Version: 2023.5.0
4
+ Summary: Open-source home automation platform running on Python 3.
5
+ Author-email: Maikel Punie <maikel.punie@gmail.com>
8
6
  License: MIT
7
+ Project-URL: Source Code, https://github.com/Cereal2nd/velbus-aio
8
+ Project-URL: Bug Reports, https://github.com/Cereal2nd/velbus-aio/issues
9
9
  Keywords: home,velbus,automation
10
10
  Platform: any
11
11
  Classifier: Development Status :: 5 - Production/Stable
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Topic :: Home Automation
22
22
  Classifier: Topic :: Software Development :: Libraries
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Python: >=3.8
24
+ Requires-Python: >=3.8.0
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
 
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+
4
+ [project]
5
+ name = "velbus-aio"
6
+ license = {text = "MIT"}
7
+ version = "2023.5.0"
8
+ description = "Open-source home automation platform running on Python 3."
9
+ readme = "README.md"
10
+ authors = [
11
+ {name = "Maikel Punie", email = "maikel.punie@gmail.com"}
12
+ ]
13
+ keywords = ["home", "velbus", "automation"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Natural Language :: English",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Topic :: Home Automation",
26
+ "Topic :: Software Development :: Libraries",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ ]
29
+ requires-python = ">=3.8.0"
30
+ dependencies = [
31
+ "pyserial>=3.5.0",
32
+ "pyserial-asyncio>=0.5",
33
+ "backoff>=1.10.0",
34
+ ]
35
+
36
+ [project.urls]
37
+ "Source Code" = "https://github.com/Cereal2nd/velbus-aio"
38
+ "Bug Reports" = "https://github.com/Cereal2nd/velbus-aio/issues"
39
+
40
+ [tool.setuptools]
41
+ platforms = ["any"]
42
+ zip-safe = false
43
+ include-package-data = true
44
+
45
+ [tool.setuptools.packages.find]
46
+ exclude = ["tests", "tests.*", "examples"]
47
+
48
+ [tool.bumpver]
49
+ current_version = "2023.5.0"
50
+ version_pattern = "YYYY.MM.INC0"
51
+ commit_message = "bump version {old_version} -> {new_version}"
52
+ commit = true
53
+ tag = true
54
+ push = true
55
+
56
+ [tool.bumpver.file_patterns]
57
+ "pyproject.toml" = [
58
+ 'version = "{version}"',
59
+ 'current_version = "{version}"',
60
+ ]
61
+ "setup.py" = [
62
+ "{version}",
63
+ "{pep440_version}",
64
+ ]
65
+ "README.md" = [
66
+ "{version}",
67
+ "{pep440_version}",
68
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from setuptools import setup
2
+
3
+ setup()
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: velbus-aio
3
- Version: 2022.12.0
4
- Summary: Python Library for the Velbus protocol based on asyncio
5
- Home-page: https://github.com/Cereal2nd/velbus-aio
6
- Author: Maikel Punie
7
- Author-email: maikel.punie@gmail.com
3
+ Version: 2023.5.0
4
+ Summary: Open-source home automation platform running on Python 3.
5
+ Author-email: Maikel Punie <maikel.punie@gmail.com>
8
6
  License: MIT
7
+ Project-URL: Source Code, https://github.com/Cereal2nd/velbus-aio
8
+ Project-URL: Bug Reports, https://github.com/Cereal2nd/velbus-aio/issues
9
9
  Keywords: home,velbus,automation
10
10
  Platform: any
11
11
  Classifier: Development Status :: 5 - Production/Stable
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Topic :: Home Automation
22
22
  Classifier: Topic :: Software Development :: Libraries
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Python: >=3.8
24
+ Requires-Python: >=3.8.0
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
 
@@ -1,12 +1,13 @@
1
1
  LICENSE
2
2
  MANIFEST.in
3
3
  README.md
4
+ pyproject.toml
4
5
  requirements.txt
5
- setup.cfg
6
6
  setup.py
7
7
  velbus_aio.egg-info/PKG-INFO
8
8
  velbus_aio.egg-info/SOURCES.txt
9
9
  velbus_aio.egg-info/dependency_links.txt
10
+ velbus_aio.egg-info/not-zip-safe
10
11
  velbus_aio.egg-info/requires.txt
11
12
  velbus_aio.egg-info/top_level.txt
12
13
  velbusaio/__init__.py
@@ -46,6 +47,7 @@ velbusaio/messages/dali_device_settings_request.py
46
47
  velbusaio/messages/dali_dim_value_status.py
47
48
  velbusaio/messages/dimmer_channel_status.py
48
49
  velbusaio/messages/dimmer_status.py
50
+ velbusaio/messages/edge_set_color.py
49
51
  velbusaio/messages/edge_set_custom_color.py
50
52
  velbusaio/messages/fast_blinking_led.py
51
53
  velbusaio/messages/forced_off.py
@@ -18,6 +18,7 @@ from velbusaio.const import (
18
18
  VOLUME_LITERS_HOUR,
19
19
  )
20
20
  from velbusaio.message import Message
21
+ from velbusaio.messages.edge_set_color import SetEdgeColorMessage, CustomColorPriority
21
22
  from velbusaio.messages.module_status import PROGRAM_SELECTION
22
23
 
23
24
  if TYPE_CHECKING:
@@ -275,6 +276,7 @@ class Button(Channel):
275
276
  _enabled = True
276
277
  _closed = False
277
278
  _led_state = None
279
+ _long = False
278
280
 
279
281
  def get_categories(self) -> list[str]:
280
282
  if self._enabled:
@@ -702,8 +704,42 @@ class EdgeLit(Channel):
702
704
  An EdgeLit channel
703
705
  """
704
706
 
705
- # def get_categories(self):
706
- # return ["light"]
707
+ async def reset_color(self, left=True, top=True, right=True, bottom=True):
708
+ msg = SetEdgeColorMessage(self._address)
709
+ msg.apply_background_color = True
710
+ msg.color_idx = 0
711
+ msg.apply_to_left_edge = left
712
+ msg.apply_to_top_edge = top
713
+ msg.apply_to_right_edge = right
714
+ msg.apply_to_bottom_edge = bottom
715
+ msg.apply_to_all_pages = True
716
+ await self._writer(msg)
717
+
718
+ async def set_color(
719
+ self,
720
+ color_idx: int,
721
+ left=True,
722
+ top=True,
723
+ right=True,
724
+ bottom=True,
725
+ blinking=False,
726
+ priority=CustomColorPriority.LOW_PRIORITY,
727
+ ) -> None:
728
+ """
729
+ Send the turn off message
730
+ """
731
+
732
+ msg = SetEdgeColorMessage(self._address)
733
+ msg.apply_background_color = True
734
+ msg.background_blinking = blinking
735
+ msg.color_idx = color_idx
736
+ msg.apply_to_left_edge = left
737
+ msg.apply_to_top_edge = top
738
+ msg.apply_to_right_edge = right
739
+ msg.apply_to_bottom_edge = bottom
740
+ msg.apply_to_all_pages = True
741
+ msg.custom_color_priority = priority
742
+ await self._writer(msg)
707
743
 
708
744
 
709
745
  class Memo(Channel):
@@ -739,7 +775,7 @@ class SelectedProgram(Channel):
739
775
  return None
740
776
 
741
777
  def get_options(self) -> list:
742
- return PROGRAM_SELECTION.values()
778
+ return list(PROGRAM_SELECTION.values())
743
779
 
744
780
  def get_selected_program(self) -> str:
745
781
  return self._selected_program_str
@@ -101,7 +101,7 @@ class PacketHandler:
101
101
  msg.populate(priority, address, rtr, data)
102
102
  self._log.debug(f"Received {msg}")
103
103
  # send the message to the modules
104
- await (self._velbus.get_module(msg.address)).on_message(msg)
104
+ await self._velbus.get_module(msg.address).on_message(msg)
105
105
  else:
106
106
  self._log.warning(
107
107
  "NOT FOUND IN command_registry: addr={} cmd={} packet={}".format(
@@ -66,6 +66,7 @@ from velbusaio.messages.receive_buffer_full import ReceiveBufferFullMessage
66
66
  from velbusaio.messages.receive_ready import ReceiveReadyMessage
67
67
  from velbusaio.messages.relay_status import RelayStatusMessage
68
68
  from velbusaio.messages.restore_dimmer import RestoreDimmerMessage
69
+ from velbusaio.messages.select_program import SelectProgramMessage
69
70
  from velbusaio.messages.sensor_temp_request import SensorTempRequest
70
71
  from velbusaio.messages.sensor_temperature import SensorTemperatureMessage
71
72
  from velbusaio.messages.set_date import SetDate
@@ -0,0 +1,113 @@
1
+ from __future__ import annotations
2
+
3
+ from enum import IntEnum
4
+ from velbusaio.command_registry import register
5
+ from velbusaio.message import Message
6
+
7
+ COMMAND_CODE = 0xD4
8
+
9
+
10
+ class CustomColorPriority(IntEnum):
11
+ LOW_PRIORITY = 1
12
+ MID_PRIORITY = 2
13
+ HIGH_PRIORITY = 3
14
+
15
+
16
+ @register(COMMAND_CODE, ["VMBEL1", "VMBEL2", "VMBEL4", "VMBELO"])
17
+ class SetEdgeColorMessage(Message):
18
+ """
19
+ send by:
20
+ received by: VMBEL1, VMBEL2, VMBEL4, VMBELO
21
+ """
22
+
23
+ apply_background_color = False
24
+ apply_continuous_feedback_color = False
25
+ apply_slow_blinking_feedback_color = False
26
+ apply_fast_blinking_feedback_color = False
27
+ custom_color_palette = False
28
+
29
+ apply_to_left_edge = False
30
+ apply_to_top_edge = False
31
+ apply_to_right_edge = False
32
+ apply_to_bottom_edge = False
33
+
34
+ apply_to_page: int | None = None
35
+ apply_to_all_pages = False
36
+
37
+ background_blinking = False
38
+ custom_color_priority: CustomColorPriority | None = None
39
+
40
+ color_idx: int = 0
41
+
42
+ def populate(self, priority, address, rtr, data):
43
+ """
44
+ :return: None
45
+ """
46
+ self.needs_no_rtr(rtr)
47
+ self.set_attributes(priority, address, rtr)
48
+
49
+ self.apply_background_color = bool(data[0] & 0x01)
50
+ self.apply_continuous_feedback_color = bool(data[0] & 0x02)
51
+ self.apply_slow_blinking_feedback_color = bool(data[0] & 0x04)
52
+ self.apply_fast_blinking_feedback_color = bool(data[0] & 0x08)
53
+ self.custom_color_palette = bool(data[0] & 0x80)
54
+
55
+ self.apply_to_left_edge = bool(data[1] & 0x01)
56
+ self.apply_to_top_edge = bool(data[1] & 0x02)
57
+ self.apply_to_right_edge = bool(data[1] & 0x04)
58
+ self.apply_to_bottom_edge = bool(data[1] & 0x08)
59
+
60
+ page = (data[1] & 0b0111_0000) >> 4
61
+ if page > 0:
62
+ self.apply_to_page = page
63
+ self.apply_to_all_pages = bool(data[1] & 0x80)
64
+
65
+ self.background_blinking = bool(data[2] & 0x80)
66
+
67
+ custom_color_priority_value = data[2] & 0b0110_0000 >> 5
68
+ if custom_color_priority_value:
69
+ self.custom_color_priority = CustomColorPriority(
70
+ custom_color_priority_value
71
+ )
72
+
73
+ self.color_idx = data[2] & 0b0001_1111
74
+
75
+ def data_to_binary(self):
76
+ """
77
+ :return: bytes
78
+ """
79
+
80
+ byte_2 = (
81
+ self.apply_background_color * 0x01
82
+ + self.apply_continuous_feedback_color * 0x02
83
+ + self.apply_slow_blinking_feedback_color * 0x04
84
+ + self.apply_fast_blinking_feedback_color * 0x08
85
+ + self.custom_color_palette * 0x80
86
+ )
87
+
88
+ byte_3 = (
89
+ self.apply_to_left_edge * 0x01
90
+ + self.apply_to_top_edge * 0x02
91
+ + self.apply_to_right_edge * 0x04
92
+ + self.apply_to_bottom_edge * 0x08
93
+ + (((self.apply_to_page or 0) & 0xFFF) << 4)
94
+ + self.apply_to_all_pages * 0x80
95
+ )
96
+
97
+ byte_4 = (
98
+ (self.color_idx & 0xFFFF)
99
+ + (
100
+ (int(self.custom_color_priority) if self.custom_color_priority else 0)
101
+ << 5
102
+ )
103
+ + self.background_blinking * 0x80
104
+ )
105
+
106
+ return bytes(
107
+ [
108
+ COMMAND_CODE,
109
+ byte_2,
110
+ byte_3,
111
+ byte_4,
112
+ ]
113
+ )
@@ -9,11 +9,11 @@ from velbusaio.message import Message
9
9
  COMMAND_CODE = 0xD4
10
10
 
11
11
 
12
- @register(COMMAND_CODE)
12
+ @register(COMMAND_CODE, ["VMBEL1", "VMBEL2", "VMBEL4", "VMBELO"])
13
13
  class EdgeSetCustomColor(Message):
14
14
  """
15
15
  send by:
16
- received by: VMB4RYLD
16
+ received by: VMBEL1, VMBEL2, VMBEL4, VMBELO
17
17
  """
18
18
 
19
19
  def __init__(self, address=None):
@@ -59,5 +59,6 @@ class RestoreDimmerMessage2(RestoreDimmerMessage):
59
59
  return [byte]
60
60
 
61
61
  def channels_to_byte(self, channels: list[int]) -> int:
62
- assert len(channels) == 1
62
+ if len(channels) != 1:
63
+ raise ValueError("We should have exact one channel")
63
64
  return channels[0]
@@ -67,5 +67,6 @@ class SetDimmerMessage2(SetDimmerMessage):
67
67
  return [byte]
68
68
 
69
69
  def channels_to_byte(self, channels) -> int:
70
- assert len(channels) == 1
70
+ if len(channels) != 1:
71
+ raise ValueError("We should have exact one channel")
71
72
  return channels[0]
@@ -176,7 +176,7 @@ class Module:
176
176
  # The solution would be that this functions knows were the temperature channels are located
177
177
  # and/or what the max number of subaddresses are for each module.
178
178
  if self._sub_address == {}:
179
- assert "No subaddresses defined"
179
+ raise Exception("No subaddresses defined")
180
180
  for sub in range(1, 4):
181
181
  if sub not in self._sub_address:
182
182
  for i in range(((sub * 8) + 1), (((sub + 1) * 8) + 1)):
@@ -372,8 +372,12 @@ class Module:
372
372
  channel = self._translate_channel_name(channel_id + _channel_offset)
373
373
  if channel_id in message.closed:
374
374
  await self._update_channel(channel, {"closed": True})
375
+ if channel_id in message.closed_long:
376
+ await self._update_channel(channel, {"long": True})
375
377
  if channel_id in message.opened:
376
- await self._update_channel(channel, {"closed": False})
378
+ await self._update_channel(
379
+ channel, {"closed": False, "long": False}
380
+ )
377
381
  elif isinstance(message, (ModuleStatusMessage)):
378
382
  for channel_id in range(1, 9):
379
383
  channel = self._translate_channel_name(channel_id + _channel_offset)
@@ -78,10 +78,10 @@ class ParseError(Exception):
78
78
 
79
79
 
80
80
  def _parse(rawmessage: bytearray) -> Tuple[Optional[RawMessage], bytearray]:
81
- assert (
82
- MINIMUM_MESSAGE_SIZE <= len(rawmessage) <= MAXIMUM_MESSAGE_SIZE
83
- ), "Received a raw message with an illegal length"
84
- assert rawmessage[0] == START_BYTE
81
+ if len(rawmessage) < MINIMUM_MESSAGE_SIZE or len(rawmessage) > MAXIMUM_MESSAGE_SIZE:
82
+ raise ValueError("Received a raw message with an illegal lemgth")
83
+ if rawmessage[0] != START_BYTE:
84
+ raise ValueError("Received a raw message with the wrong startbyte")
85
85
 
86
86
  priority = rawmessage[1]
87
87
  if priority not in PRIORITIES:
@@ -6,8 +6,10 @@ from velbusaio.const import MAXIMUM_MESSAGE_SIZE, MINIMUM_MESSAGE_SIZE
6
6
  # Copyright (c) 2017 Thomas Delaet
7
7
  # Copied from python-velbus (https://github.com/thomasdelaet/python-velbus)
8
8
  def checksum(data: Union[bytes, bytearray]) -> int:
9
- assert len(data) >= MINIMUM_MESSAGE_SIZE - 2
10
- assert len(data) <= MAXIMUM_MESSAGE_SIZE - 2
9
+ if len(data) < MINIMUM_MESSAGE_SIZE - 2:
10
+ raise ValueError("The message is shorter then expected")
11
+ if len(data) > MAXIMUM_MESSAGE_SIZE - 2:
12
+ raise ValueError("The message is longer then expected")
11
13
  __checksum = 0
12
14
  for data_byte in data:
13
15
  __checksum += data_byte
@@ -35,12 +37,13 @@ class BitSet:
35
37
  self._value = value
36
38
 
37
39
  def __getitem__(self, idx: int) -> bool:
38
- assert 0 <= idx < 8
40
+ if idx > 8 or idx <= 0:
41
+ raise ValueError("The bitSet id is not within expected range 0 < id < 8")
39
42
  return bool((1 << idx) & self._value)
40
43
 
41
44
  def __setitem__(self, idx: int, value: bool) -> None:
42
- assert 0 <= idx < 8
43
- assert isinstance(value, bool)
45
+ if idx > 8 or idx <= 0:
46
+ raise ValueError("The bitSet id is not within expected range 0 < id < 8")
44
47
  mask = (0xFF ^ (1 << idx)) & self._value
45
48
  self._value = mask & (value << idx)
46
49
 
@@ -1,27 +0,0 @@
1
- [metadata]
2
- license = MIT
3
- license_file = LICENSE
4
- platforms = any
5
- description = Python Library for the Velbus protocol based on asyncio
6
- long_description = file: README.md
7
- long_description_content_type = text/markdown
8
- keywords = home, velbus, automation
9
- classifier =
10
- Development Status :: 5 - Production/Stable
11
- Intended Audience :: Developers
12
- License :: OSI Approved :: MIT License
13
- Natural Language :: English
14
- Operating System :: OS Independent
15
- Programming Language :: Python
16
- Programming Language :: Python :: 3.8
17
- Programming Language :: Python :: 3.9
18
- Programming Language :: Python :: 3.10
19
- Programming Language :: Python :: 3.11
20
- Topic :: Home Automation
21
- Topic :: Software Development :: Libraries
22
- Topic :: Software Development :: Libraries :: Python Modules
23
-
24
- [egg_info]
25
- tag_build =
26
- tag_date = 0
27
-
@@ -1,22 +0,0 @@
1
- from setuptools import find_packages, setup
2
-
3
- PACKAGES = find_packages(exclude=["tests", "tests.*"])
4
-
5
- setup(
6
- name="velbus-aio",
7
- version="2022.12.0",
8
- url="https://github.com/Cereal2nd/velbus-aio",
9
- license="MIT",
10
- author="Maikel Punie",
11
- install_requires=[
12
- "pyserial>=3.5.0",
13
- "pyserial-asyncio>=0.5",
14
- "backoff>=1.10.0",
15
- ],
16
- author_email="maikel.punie@gmail.com",
17
- packages=PACKAGES,
18
- include_package_data=True,
19
- platforms="any",
20
- python_requires=">=3.8",
21
- test_suite="tests",
22
- )
File without changes
File without changes