velbus-aio 2023.12.0__py3-none-any.whl → 2024.4.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.

Files changed (100) hide show
  1. {velbus_aio-2023.12.0.dist-info → velbus_aio-2024.4.1.dist-info}/METADATA +2 -1
  2. velbus_aio-2024.4.1.dist-info/RECORD +103 -0
  3. {velbus_aio-2023.12.0.dist-info → velbus_aio-2024.4.1.dist-info}/WHEEL +1 -1
  4. velbusaio/channels.py +7 -11
  5. velbusaio/command_registry.py +15 -1
  6. velbusaio/const.py +3 -1
  7. velbusaio/controller.py +39 -68
  8. velbusaio/handler.py +5 -61
  9. velbusaio/helpers.py +2 -1
  10. velbusaio/message.py +1 -1
  11. velbusaio/messages/__init__.py +1 -0
  12. velbusaio/messages/blind_status.py +1 -0
  13. velbusaio/messages/bus_active.py +1 -0
  14. velbusaio/messages/bus_error_counter_status.py +1 -0
  15. velbusaio/messages/bus_error_counter_status_request.py +1 -0
  16. velbusaio/messages/bus_off.py +1 -0
  17. velbusaio/messages/channel_name_part1.py +15 -0
  18. velbusaio/messages/channel_name_part2.py +14 -0
  19. velbusaio/messages/channel_name_part3.py +14 -0
  20. velbusaio/messages/channel_name_request.py +2 -1
  21. velbusaio/messages/clear_led.py +1 -0
  22. velbusaio/messages/counter_status.py +1 -0
  23. velbusaio/messages/counter_status_request.py +1 -0
  24. velbusaio/messages/cover_down.py +1 -0
  25. velbusaio/messages/cover_off.py +1 -2
  26. velbusaio/messages/cover_position.py +1 -2
  27. velbusaio/messages/cover_up.py +1 -0
  28. velbusaio/messages/dali_device_settings.py +2 -1
  29. velbusaio/messages/dali_device_settings_request.py +2 -1
  30. velbusaio/messages/dali_dim_value_status.py +2 -1
  31. velbusaio/messages/dimmer_channel_status.py +2 -1
  32. velbusaio/messages/dimmer_status.py +1 -0
  33. velbusaio/messages/edge_set_custom_color.py +1 -0
  34. velbusaio/messages/fast_blinking_led.py +1 -0
  35. velbusaio/messages/forced_off.py +1 -0
  36. velbusaio/messages/forced_on.py +1 -0
  37. velbusaio/messages/interface_status_request.py +1 -0
  38. velbusaio/messages/ir_receiver_status.py +1 -0
  39. velbusaio/messages/kwh_status.py +1 -0
  40. velbusaio/messages/light_value_request.py +1 -0
  41. velbusaio/messages/memo_text.py +1 -0
  42. velbusaio/messages/memory_data.py +1 -0
  43. velbusaio/messages/memory_data_block.py +1 -0
  44. velbusaio/messages/memory_dump_request.py +1 -0
  45. velbusaio/messages/module_status.py +12 -0
  46. velbusaio/messages/module_status_request.py +1 -0
  47. velbusaio/messages/module_subtype.py +1 -0
  48. velbusaio/messages/module_type.py +1 -0
  49. velbusaio/messages/module_type_request.py +1 -0
  50. velbusaio/messages/push_button_status.py +1 -0
  51. velbusaio/messages/raw.py +1 -0
  52. velbusaio/messages/read_data_block_from_memory.py +1 -0
  53. velbusaio/messages/read_data_from_memory.py +1 -0
  54. velbusaio/messages/realtime_clock_status_request.py +1 -0
  55. velbusaio/messages/receive_buffer_full.py +1 -0
  56. velbusaio/messages/receive_ready.py +1 -0
  57. velbusaio/messages/relay_status.py +1 -0
  58. velbusaio/messages/restore_dimmer.py +6 -2
  59. velbusaio/messages/select_program.py +1 -0
  60. velbusaio/messages/sensor_settings_request.py +1 -0
  61. velbusaio/messages/sensor_temp_request.py +1 -0
  62. velbusaio/messages/sensor_temperature.py +1 -0
  63. velbusaio/messages/set_date.py +5 -10
  64. velbusaio/messages/set_daylight_saving.py +3 -6
  65. velbusaio/messages/set_dimmer.py +6 -2
  66. velbusaio/messages/set_led.py +1 -0
  67. velbusaio/messages/set_realtime_clock.py +5 -10
  68. velbusaio/messages/set_temperature.py +1 -0
  69. velbusaio/messages/slider_status.py +5 -1
  70. velbusaio/messages/slow_blinking_led.py +1 -0
  71. velbusaio/messages/start_relay_blinking_timer.py +1 -0
  72. velbusaio/messages/start_relay_timer.py +1 -0
  73. velbusaio/messages/switch_relay_off.py +1 -0
  74. velbusaio/messages/switch_relay_on.py +1 -0
  75. velbusaio/messages/switch_to_comfort.py +1 -0
  76. velbusaio/messages/switch_to_day.py +1 -0
  77. velbusaio/messages/switch_to_night.py +1 -0
  78. velbusaio/messages/switch_to_safe.py +1 -0
  79. velbusaio/messages/temp_sensor_settings_part1.py +1 -0
  80. velbusaio/messages/temp_sensor_settings_part2.py +1 -0
  81. velbusaio/messages/temp_sensor_settings_part3.py +1 -0
  82. velbusaio/messages/temp_sensor_settings_part4.py +1 -0
  83. velbusaio/messages/temp_sensor_settings_request.py +1 -0
  84. velbusaio/messages/temp_sensor_status.py +1 -0
  85. velbusaio/messages/temp_set_cooling.py +1 -0
  86. velbusaio/messages/temp_set_heating.py +1 -0
  87. velbusaio/messages/update_led_status.py +1 -0
  88. velbusaio/messages/very_fast_blinking_led.py +1 -0
  89. velbusaio/messages/write_data_to_memory.py +1 -0
  90. velbusaio/messages/write_memory_block.py +1 -0
  91. velbusaio/messages/write_module_address_and_serial_number.py +1 -0
  92. velbusaio/module.py +44 -43
  93. velbusaio/protocol.json +10126 -0
  94. velbusaio/protocol.py +2 -2
  95. velbusaio/raw_message.py +6 -6
  96. velbusaio/util.py +4 -0
  97. velbus_aio-2023.12.0.dist-info/RECORD +0 -103
  98. velbusaio/moduleprotocol/protocol.json +0 -26507
  99. {velbus_aio-2023.12.0.dist-info → velbus_aio-2024.4.1.dist-info}/LICENSE +0 -0
  100. {velbus_aio-2023.12.0.dist-info → velbus_aio-2024.4.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: velbus-aio
3
- Version: 2023.12.0
3
+ Version: 2024.4.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
@@ -30,6 +30,7 @@ Requires-Dist: pyserial-asyncio >=0.5
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)
33
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Cereal2nd/velbus-aio/master.svg)](https://results.pre-commit.ci/latest/github/Cereal2nd/velbus-aio/master)
33
34
 
34
35
  # velbus-aio
35
36
 
@@ -0,0 +1,103 @@
1
+ velbusaio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ velbusaio/channels.py,sha256=v7hZoT7X3-fNBAvTKgVpxCY33HhUC9Ga4XTCMqJ3dTA,22799
3
+ velbusaio/command_registry.py,sha256=j9KuLmada41PMEdtfPvLmXVOAZOkBM9zi-3kluwYffk,5140
4
+ velbusaio/const.py,sha256=aysTlQcpACZaDVqoXAjWmaEDGlCB7KT04Rv-SAusPFc,1575
5
+ velbusaio/controller.py,sha256=O9BAOFTb3GjTRX8EOrkIifqWN9GIp9Pm4x6__m5wa7A,8756
6
+ velbusaio/discovery.py,sha256=Px6qoZl4QhF17aMz6JxstCORBpLzZGWEK9h4Vyvg57o,1649
7
+ velbusaio/exceptions.py,sha256=FHkXaM3dK5Gkk-QGAf9dLE3FPlCU2FRZWUyY-4KRNnA,515
8
+ velbusaio/handler.py,sha256=jTWIV26ibAqs3rcTku81NIHlPUeyWjStSih1Nfx-an0,5946
9
+ velbusaio/helpers.py,sha256=iqpoereRH4JY5WAkozIqWvXWyRmhko-J-UGXDylFyEM,2537
10
+ velbusaio/message.py,sha256=gnhXpA5NAG4qnI9vlxwlWQKETWneDb1lp0P9w_-nxhQ,5020
11
+ velbusaio/module.py,sha256=sHOnGjuV--_aw83yh_Gx5CiRPDOBRr1PemVg5z5YYoQ,35467
12
+ velbusaio/protocol.json,sha256=7PifRZXctU5zSsodDGsUAhnnSsGNlcGcim1gr2su720,250396
13
+ velbusaio/protocol.py,sha256=ofDwJfwyrVQDQ40WX2QdH1nTK-y2HibQPTo5dFY7SkQ,8224
14
+ velbusaio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ velbusaio/raw_message.py,sha256=ODoTPVAvyXXQSMXxtQO1U5OxcoQ4W8JJN5fotEDGSTo,4690
16
+ velbusaio/util.py,sha256=FW6YCiPYWOCgqHDs8-LbzME0h81mqftYVG0qqZ-oo7Y,1568
17
+ velbusaio/messages/__init__.py,sha256=hLkLhsJ5hcgRnhaoyFWz1g2vphdnjrXURxgwezkDBwU,5893
18
+ velbusaio/messages/blind_status.py,sha256=yzjoYLBxH85tBjihiGzLqebRg1urz0obBA-3q1pqSCE,3418
19
+ velbusaio/messages/bus_active.py,sha256=AB1mEvbMXRuOaC2CQ7hzKSLmbaJnyFqqXrARi-aSdtg,749
20
+ velbusaio/messages/bus_error_counter_status.py,sha256=x0RIzil6IcXWq6GHEFYDkSAergNF51JQYyetDXjvvzY,1178
21
+ velbusaio/messages/bus_error_counter_status_request.py,sha256=zjX3k8MKgR9FO253a7bIlO-ba6SHmLi2WZT6ayAicrw,703
22
+ velbusaio/messages/bus_off.py,sha256=z0PmNZyTlwee6jXnzgK4zHhFvevAXNboDrEEQvyLLfc,679
23
+ velbusaio/messages/channel_name_part1.py,sha256=_6zpf0niulSVKxr2F1eXXOyfX0159OtOJQyg5HUqQ8I,2883
24
+ velbusaio/messages/channel_name_part2.py,sha256=gPg_wShY-PgIDUm7uLB8_6WoA8-RgbRFNhULvCvj9as,2858
25
+ velbusaio/messages/channel_name_part3.py,sha256=AIc79eefKok7WwVYKZrwBTEHM1hyjTmqzWjpJquOAl8,2859
26
+ velbusaio/messages/channel_name_request.py,sha256=t8Tpx9l4XLgF6cDwUylXk0r8vmNG2QrXJq9F4TwAaBg,2378
27
+ velbusaio/messages/clear_led.py,sha256=AcGRCD0OdlHcFonvHA075nVwvOtZ6KfyjrXeE6A7DZA,912
28
+ velbusaio/messages/counter_status.py,sha256=UgSRw-pipFb8C2DxauHw8Pjem1qTvzUFpiahui73-Is,1240
29
+ velbusaio/messages/counter_status_request.py,sha256=VLFaI7MFnTCH1s8acfKlcAGscJElwxYRC56eT3bbB7Y,919
30
+ velbusaio/messages/cover_down.py,sha256=tdjsRijrEa5oNBZk6uKWUK39k5gIjcWq0kgfOf4f1lQ,2552
31
+ velbusaio/messages/cover_off.py,sha256=0RHAJb4et99yAoo8LD85Rzlnhrqr40Wjba-BhzHSr4o,2243
32
+ velbusaio/messages/cover_position.py,sha256=PhRocdkbwf8CUfdL8-rZHEDFD2Z9u7DLZOpH3h6gAtg,1268
33
+ velbusaio/messages/cover_up.py,sha256=P20AZx8qQScbyV0sxtZOlO03Q8pFO8NunpqIr4mZ6Lw,2547
34
+ velbusaio/messages/dali_device_settings.py,sha256=KzJ7OFkFRPuCXSOThuplM48J_kH0I3RE82ZRCpmiqYA,4870
35
+ velbusaio/messages/dali_device_settings_request.py,sha256=InTnrwLD7l9gCHXKlJ69FHMXcejtYMUZBtnffx9nDQU,1476
36
+ velbusaio/messages/dali_dim_value_status.py,sha256=Kgtfb65HCku4OBm6uaxKFpK3VtlYaTemSjMhZqngqkY,1059
37
+ velbusaio/messages/dimmer_channel_status.py,sha256=uk0SqV3EMJcDGZjoJDA_iHEpgk57qaa7xg1CQkSlIvc,2484
38
+ velbusaio/messages/dimmer_status.py,sha256=pWsWXJGWmYGio4FyUktI9aYnIBQkGCQ5ZwaeqnenYsU,2938
39
+ velbusaio/messages/edge_set_color.py,sha256=enwPshhNrleAQQwc3RobPt5foZ1ynE_74SlBEuzd86w,3305
40
+ velbusaio/messages/edge_set_custom_color.py,sha256=Lz-7prBveqPwuDWv2Mn13X9TAXGBEquw8xz2_y9NtTk,1338
41
+ velbusaio/messages/fast_blinking_led.py,sha256=_AaG6NcjzG_cBNARogzu56l7DNpGU11XGrDHIkMuKss,909
42
+ velbusaio/messages/forced_off.py,sha256=RhYRkd7bbq4Nvg2mOp8Vmg3zvhyGeXYeAYJC8iQ_Bzw,591
43
+ velbusaio/messages/forced_on.py,sha256=38ZDMP70wcZ2I0w0w6HUROakhdl8bhVNELGpMCDqo6E,590
44
+ velbusaio/messages/interface_status_request.py,sha256=V0qfK1FM-uTT3ChXPiUOY0FdHJIB5rp4vLbOFjzgZMQ,695
45
+ velbusaio/messages/ir_receiver_status.py,sha256=EfCSaB0FRy1h1ofjRa-kim-oPnwWeHDmaw8XATRpJFE,375
46
+ velbusaio/messages/kwh_status.py,sha256=qUeHfA_66MCGUw3A-Kz9bMaw-WUZYJvc-vEcru51KiY,1414
47
+ velbusaio/messages/light_value_request.py,sha256=ysejBpgiifSCFHh88sKvou7f1BSqchCmTMAT3kjAGX0,599
48
+ velbusaio/messages/memo_text.py,sha256=RwAjm14oths6rmsjC8WFFS7uOD9UHRue1UxTd4AuQHU,1031
49
+ velbusaio/messages/memory_data.py,sha256=kH_jTCZCyivRnD3DJeiWKDTG01Vk91LbdRXVjj8WHBU,1031
50
+ velbusaio/messages/memory_data_block.py,sha256=3QufrOahEkIhJjivWtOXp62YuVaUwx6trA-OQls6ohQ,1045
51
+ velbusaio/messages/memory_dump_request.py,sha256=xrPsdpygD9DUF3lp-BzJacuq1dNkqz2wtHpqu_F1zVM,699
52
+ velbusaio/messages/module_status.py,sha256=83UrRFXgRRngcF36fogyw8G5XPFlyaoZoW7XlxwvnQE,6637
53
+ velbusaio/messages/module_status_request.py,sha256=s3h8F6Dpmjcb4hqDQKIzdOgocW1F_st40cctcW7WmQ4,961
54
+ velbusaio/messages/module_subtype.py,sha256=VQXQ-c_yFbj9_64SjfiM-PLk1hV7xUWIcQ1DZYTpKhI,1464
55
+ velbusaio/messages/module_type.py,sha256=toHlsLoek61cQ9JXG3alJyAuQtny1RSY7K6cM4hfNOk,4116
56
+ velbusaio/messages/module_type_request.py,sha256=fntMYCF1WVwSseCy3zRoZQH6JeGz8JDfTkwHC3AvcB4,754
57
+ velbusaio/messages/push_button_status.py,sha256=SRFLvNC00FdKDTSb4kNVSHeXI1i5Ey5ENxpsB3B8FuU,1554
58
+ velbusaio/messages/raw.py,sha256=pepZSUVY-ro5jv3ZyO6BI3ap5RZ2g_Bd9dlbaICFldQ,1964
59
+ velbusaio/messages/read_data_block_from_memory.py,sha256=GQwnO71rwPTFgu4YyB4FNQs4_G4dAOGuAsBqwBzmpXs,975
60
+ velbusaio/messages/read_data_from_memory.py,sha256=0Sy9x-7HmkazohpUqFT-647EUmCL8swIgcCpb93a-Fg,978
61
+ velbusaio/messages/realtime_clock_status_request.py,sha256=cDhA8lkCfvHtYwKIQ-bewCfg6xS6Uo4Ruj8KF6aGvDs,608
62
+ velbusaio/messages/receive_buffer_full.py,sha256=Xg4zy6rM-3Zxp3wjRRpVXA3UsFIiUZA0l-vU8c_Y33Q,858
63
+ velbusaio/messages/receive_ready.py,sha256=BjIu-zWlrBGV2BF1BdKF6jUbfzNLAUblq3SRTtF_0rg,687
64
+ velbusaio/messages/relay_status.py,sha256=du16mnJXIzbDSsaIJnoN5KkdqsloOgNkfoFuu3x_F5Y,2837
65
+ velbusaio/messages/restore_dimmer.py,sha256=YQsR7NF1pC40KaegxQhqcmL2mL57aPHsgzdA3YHrLxQ,1822
66
+ velbusaio/messages/select_program.py,sha256=9jLhsCuYGQsw-FMxpmNljPZifGeE_oJ6A5bgCRI2JJ0,835
67
+ velbusaio/messages/sensor_settings_request.py,sha256=Uwywf0JGwBwc_2ZlfxVJicm3oUlWBNEcclcHA2_Mv5I,819
68
+ velbusaio/messages/sensor_temp_request.py,sha256=bTChj9udOjIww9vJ2SWmMtbry_8jLDvbWSAy_ZPmrb4,599
69
+ velbusaio/messages/sensor_temperature.py,sha256=ThA_4FFhQutCSt8147yCy7ocUFfizWaUV2JHoNzesNc,1558
70
+ velbusaio/messages/set_date.py,sha256=jcWb8c5mB71HNBwLCQ9ocEPSHQdZP0yfGJL4_swsRWQ,1359
71
+ velbusaio/messages/set_daylight_saving.py,sha256=CpoKrSt62UzzNxl8SDcpDcb0GKnLcD1f73-ULzqDEzU,1049
72
+ velbusaio/messages/set_dimmer.py,sha256=f2XWLbxoo0Tbj8_DUu28XSiib32VLUDtw8QRzRZBDdA,1975
73
+ velbusaio/messages/set_led.py,sha256=X8tIDzJgtf5EsH92rjoUyrECNFW-ECgAQoQ9TnvJEQk,900
74
+ velbusaio/messages/set_realtime_clock.py,sha256=h34pCvyPm7tSQ5BdB8yC8SRulrtldeX-ZJFv3Wcvdk0,1209
75
+ velbusaio/messages/set_temperature.py,sha256=78LfGOBZo2bw7eF38uyXOjUcJrsSvQPDW2qbXLOYd0o,959
76
+ velbusaio/messages/slider_status.py,sha256=AlBI1DJPLUwxOFfPIKYv15bFOnVXm__Tym7AW4xGMxo,1418
77
+ velbusaio/messages/slow_blinking_led.py,sha256=UktzpRtyM4mR7_KQuNjqenPEeM3P1vgTyMW8dnVwylQ,909
78
+ velbusaio/messages/start_relay_blinking_timer.py,sha256=AUqeXzQlxoW-jxG0YR7Lqt8QfDC1qX3u_MVSMkI783E,1298
79
+ velbusaio/messages/start_relay_timer.py,sha256=FZP4hL3t0rNF_b8GluAM_IymBRkp86epx2rJ29LXpyQ,1290
80
+ velbusaio/messages/switch_relay_off.py,sha256=zmFQP2M0dNKDIljAba0jswKCXsML1psBjfrQtmHuzPM,1099
81
+ velbusaio/messages/switch_relay_on.py,sha256=gMXV8F2rdFQMLKu3Rd1QXHqpb8RWsgcVqwnTt3C28y8,1098
82
+ velbusaio/messages/switch_to_comfort.py,sha256=_avZVz-OkEYe05syirB2N0d8IdgfxElRncNajRWMg_Y,791
83
+ velbusaio/messages/switch_to_day.py,sha256=c9ZQIfE6_tCSUksj1V_M8Pbo48-H7rbPriEtDmX6Shk,787
84
+ velbusaio/messages/switch_to_night.py,sha256=K-_19ZnnlJCOZJkEqWJ3antwHlHEjE7L5BA_H4vd99I,789
85
+ velbusaio/messages/switch_to_safe.py,sha256=5G6ZYdmi_-9W9KB-_SofUfco6ppWb802cChXHq4O6Gg,788
86
+ velbusaio/messages/temp_sensor_settings_part1.py,sha256=QBIzzfj7tB_9LQRlY92ac5IMGnEcgsvQPsyv9CHms9E,605
87
+ velbusaio/messages/temp_sensor_settings_part2.py,sha256=H7JxqsfBmIk05iTtpWfDidvyf-kGMj1YEJ-VouvAHnE,584
88
+ velbusaio/messages/temp_sensor_settings_part3.py,sha256=e9YUkcn11sRwcmvCCOzm87irJ5pdt81S3I1qGZBcTe0,584
89
+ velbusaio/messages/temp_sensor_settings_part4.py,sha256=b9s2-tj-q-ct0--_uvDOJx7JQtZ3hPShRyD5_oFGmGY,584
90
+ velbusaio/messages/temp_sensor_settings_request.py,sha256=kZG3QeHQdA-QEvp3newPGvNW8qhIrJAVcqTY1sZqtvQ,607
91
+ velbusaio/messages/temp_sensor_status.py,sha256=FnY5qFKli2P9xnpVKgysN_nOE_vx86G77Ql93vyTPEY,3828
92
+ velbusaio/messages/temp_set_cooling.py,sha256=_KzrPPdQNYLF6V8-KNehk6D82IQXNCe2obkct_QxX_c,724
93
+ velbusaio/messages/temp_set_heating.py,sha256=Au6b3Y3vpwwdfCJzO5DLOPPVJ98DBrO5_hxMtc165Ho,724
94
+ velbusaio/messages/update_led_status.py,sha256=77wRc3sQl_wXrGvGw9r9-KY17NE5mxTJYgvHWQ5DrRU,1301
95
+ velbusaio/messages/very_fast_blinking_led.py,sha256=vlMEern8PoOvtO5JaAk9erMR4IKJoWUeHJcD69S3B14,913
96
+ velbusaio/messages/write_data_to_memory.py,sha256=gr6bi4SzK8Mw8fnp8yV-STq5jts7NoeV7zZgdptH5Vs,1039
97
+ velbusaio/messages/write_memory_block.py,sha256=zGnNxx_M66HpBQ8S7kagtNw8_qSRHsOLk1MuiS0uygM,1032
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
velbusaio/channels.py CHANGED
@@ -1,6 +1,7 @@
1
1
  """
2
2
  author: Maikel Punie <maikel.punie@gmail.com>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  import asyncio
@@ -135,17 +136,8 @@ class Channel:
135
136
  if k != "_writer" and k != "_on_status_update" and k != "_name_parts"
136
137
  }
137
138
 
138
- def to_json(self) -> dict:
139
- d = self.__dict__
140
- return {
141
- k: d[k]
142
- for k in d
143
- if k != "_writer"
144
- and k != "_on_status_update"
145
- and k != "_name_parts"
146
- and k != "_module"
147
- and k != "__name__"
148
- }
139
+ def to_cache(self) -> dict:
140
+ return {"name": self._name, "type": type(self).__name__}
149
141
 
150
142
  def __setstate__(self, state):
151
143
  self.__dict__.update(state)
@@ -276,6 +268,10 @@ class Blind(Channel):
276
268
 
277
269
  async def set_position(self, position: int) -> None:
278
270
  # may not be supported by the module
271
+ if position == 100:
272
+ # at least VMB1BLS ignores command 0x1C with position 0x64
273
+ await self.close()
274
+ return
279
275
  cls = commandRegistry.get_command(0x1C, self._module.get_type())
280
276
  msg = cls(self._address)
281
277
  msg.channel = self._num
@@ -1,12 +1,15 @@
1
- """
1
+ """Command registry.
2
+
2
3
  :author: Maikel Punie <maikel.punie@gmail.com> and Thomas Delaet <thomas@delaet.org>
3
4
  """
5
+
4
6
  from __future__ import annotations
5
7
 
6
8
  MODULE_DIRECTORY = {
7
9
  0x01: "VMB8PB",
8
10
  0x02: "VMB1RY",
9
11
  0x03: "VMB1BL",
12
+ 0x04: "VMB4LEDPWM-20",
10
13
  0x05: "VMB6IN",
11
14
  0x07: "VMB1DM",
12
15
  0x08: "VMB4RY",
@@ -68,6 +71,7 @@ MODULE_DIRECTORY = {
68
71
  0x48: "VMB4RYLD-10",
69
72
  0x49: "VMB4RYNO-10",
70
73
  0x4A: "VMB2BLE-10",
74
+ 0x4B: "VMB8DC-20",
71
75
  0x4C: "VMB6PB-20",
72
76
  0x4F: "VMBEL1-20",
73
77
  0x50: "VMBEL2-20",
@@ -84,7 +88,10 @@ MODULE_DIRECTORY = {
84
88
 
85
89
 
86
90
  class CommandRegistry:
91
+ """Command registry class."""
92
+
87
93
  def __init__(self, module_directory: dict) -> None:
94
+ """Init method."""
88
95
  self._module_directory = module_directory
89
96
  self._default_commands = {}
90
97
  self._overrides = {}
@@ -92,6 +99,7 @@ class CommandRegistry:
92
99
  def register_command(
93
100
  self, command_value: int, command_class: type, module_name: str | None = None
94
101
  ) -> None:
102
+ """Register a command."""
95
103
  if command_value < 0 or command_value > 255:
96
104
  raise ValueError("Command_value should be >=0 and <=255")
97
105
  if module_name and module_name not in self._module_directory.values():
@@ -112,6 +120,7 @@ class CommandRegistry:
112
120
  def _register_override(
113
121
  self, command_value: int, command_class: type, module_type: str
114
122
  ) -> None:
123
+ """Register and override."""
115
124
  if module_type not in self._overrides:
116
125
  self._overrides[module_type] = {}
117
126
  if command_value not in self._overrides[module_type]:
@@ -122,12 +131,14 @@ class CommandRegistry:
122
131
  )
123
132
 
124
133
  def _register_default(self, command_value: int, command_class: type) -> None:
134
+ """Register a default command."""
125
135
  if command_value not in self._default_commands:
126
136
  self._default_commands[command_value] = command_class
127
137
  else:
128
138
  raise Exception("double registration in command registry")
129
139
 
130
140
  def has_command(self, command_value: int, module_type: int = 0) -> bool:
141
+ """Find a command."""
131
142
  if module_type in self._overrides:
132
143
  if command_value in self._overrides[module_type]:
133
144
  return True
@@ -136,6 +147,7 @@ class CommandRegistry:
136
147
  return False
137
148
 
138
149
  def get_command(self, command_value: int, module_type: int = 0) -> None | type:
150
+ """Search a command in the registry."""
139
151
  if module_type in self._overrides:
140
152
  if command_value in self._overrides[module_type]:
141
153
  return self._overrides[module_type][command_value]
@@ -148,6 +160,8 @@ commandRegistry = CommandRegistry(MODULE_DIRECTORY)
148
160
 
149
161
 
150
162
  def register(command_value: int, module_types: list[str] | None = None):
163
+ """Register decorator."""
164
+
151
165
  def inner_register(command_class):
152
166
  if module_types:
153
167
  for module_type in module_types:
velbusaio/const.py CHANGED
@@ -1,6 +1,8 @@
1
- """
1
+ """Constant for velbusaio.
2
+
2
3
  Author: Maikel Punie <maikel.punie@gmail.com>
3
4
  """
5
+
4
6
  from __future__ import annotations
5
7
 
6
8
  from typing import Final
velbusaio/controller.py CHANGED
@@ -1,14 +1,13 @@
1
- """
2
- Main interface for the velbusaio lib
3
- """
1
+ """Main interface for the velbusaio lib."""
2
+
4
3
  from __future__ import annotations
5
4
 
6
5
  import asyncio
7
6
  import logging
8
7
  import pathlib
9
- import pickle
10
8
  import re
11
9
  import ssl
10
+ import time
12
11
  from urllib.parse import urlparse
13
12
 
14
13
  import serial
@@ -30,15 +29,14 @@ from velbusaio.raw_message import RawMessage
30
29
 
31
30
 
32
31
  class Velbus:
33
- """
34
- A velbus controller
35
- """
32
+ """A velbus controller."""
36
33
 
37
34
  def __init__(
38
35
  self,
39
36
  dsn: str,
40
37
  cache_dir: str = get_cache_dir(),
41
38
  ) -> None:
39
+ """Init the Velbus controller."""
42
40
  self._log = logging.getLogger("velbus")
43
41
 
44
42
  self._protocol = VelbusProtocol(
@@ -59,6 +57,7 @@ class Velbus:
59
57
  pathlib.Path(self._cache_dir).mkdir(parents=True, exist_ok=True)
60
58
 
61
59
  async def _on_message_received(self, msg: RawMessage) -> None:
60
+ """On message received function."""
62
61
  await self._handler.handle(msg)
63
62
 
64
63
  def _on_connection_lost(self, exc: Exception) -> None:
@@ -68,6 +67,7 @@ class Velbus:
68
67
  asyncio.ensure_future(self.connect())
69
68
 
70
69
  def _on_end_of_scan(self) -> None:
70
+ """Notify the scan failure."""
71
71
  self._handler.scan_finished()
72
72
 
73
73
  async def add_module(
@@ -80,31 +80,23 @@ class Velbus:
80
80
  build_year: int | None = None,
81
81
  build_week: int | None = None,
82
82
  ) -> None:
83
- """
84
- Add a found module to the module cache
85
- """
86
- mod = self._load_module_from_cache(self._cache_dir, addr)
87
- if mod is not None:
88
- self._log.info(f"Load module from CACHE: {addr}")
89
- self._modules[addr] = mod
90
- self._modules[addr].initialize(self.send)
91
- await self._modules[addr].load(True)
92
- else:
93
- self._log.info(f"Load NEW module: {typ} @ {addr}")
94
- self._modules[addr] = Module.factory(
95
- addr,
96
- typ,
97
- data,
98
- serial=serial,
99
- build_year=build_year,
100
- build_week=build_week,
101
- memorymap=memorymap,
102
- cache_dir=self._cache_dir,
103
- )
104
- self._modules[addr].initialize(self.send)
105
- await self._modules[addr].load()
83
+ """Add a found module to the module cache."""
84
+ self._log.info(f"Found module: type:{typ} address:{addr}")
85
+ self._modules[addr] = Module.factory(
86
+ addr,
87
+ typ,
88
+ data,
89
+ serial=serial,
90
+ build_year=build_year,
91
+ build_week=build_week,
92
+ memorymap=memorymap,
93
+ cache_dir=self._cache_dir,
94
+ )
95
+ self._modules[addr].initialize(self.send)
96
+ await self._modules[addr].load()
106
97
 
107
98
  async def add_submodules(self, addr: int, subList: dict[int, int]) -> None:
99
+ """Add submodules address to module."""
108
100
  for sub_num, sub_addr in subList.items():
109
101
  if sub_addr == 0xFF:
110
102
  continue
@@ -113,48 +105,30 @@ class Velbus:
113
105
  self._modules[sub_addr] = self._modules[addr]
114
106
  self._modules[addr].cleanupSubChannels()
115
107
 
116
- def _load_module_from_cache(self, cache_dir: str, address: int) -> None | Module:
117
- try:
118
- cfile = pathlib.Path(f"{cache_dir}/{address}.p")
119
- with cfile.open("rb") as fl:
120
- o = pickle.load(fl)
121
- if isinstance(o, Module):
122
- return o
123
- except OSError:
124
- pass
125
- return None
126
-
127
108
  def get_modules(self) -> dict:
128
- """
129
- Return the module cache
130
- """
109
+ """Return the module cache."""
131
110
  return self._modules
132
111
 
133
112
  def get_module(self, addr: str) -> None | Module:
134
- """
135
- Get a module on an address
136
- """
137
- if addr in self._modules.keys():
113
+ """Get a module on an address."""
114
+ if addr in self._modules:
138
115
  return self._modules[addr]
139
116
  return None
140
117
 
141
118
  def get_channels(self, addr: str) -> None | dict:
142
- """
143
- Get the channels for an address
144
- """
119
+ """Get the channels for an address."""
145
120
  if addr in self._modules:
146
121
  return (self._modules[addr]).get_channels()
147
122
  return None
148
123
 
149
124
  async def stop(self) -> None:
125
+ """Stop the controller."""
150
126
  self._closing = True
151
127
  self._auto_reconnect = False
152
128
  self._protocol.close()
153
129
 
154
130
  async def connect(self, test_connect: bool = False) -> None:
155
- """
156
- Connect to the bus and load all the data
157
- """
131
+ """Connect to the bus and load all the data."""
158
132
  auth = None
159
133
  # connect to the bus
160
134
  if ":" in self._dsn:
@@ -181,7 +155,7 @@ class Velbus:
181
155
  )
182
156
 
183
157
  except (ConnectionRefusedError, OSError) as err:
184
- raise VelbusConnectionFailed() from err
158
+ raise VelbusConnectionFailed from err
185
159
  else:
186
160
  # serial port
187
161
  try:
@@ -197,7 +171,7 @@ class Velbus:
197
171
  rtscts=1,
198
172
  )
199
173
  except (FileNotFoundError, serial.SerialException) as err:
200
- raise VelbusConnectionFailed() from err
174
+ raise VelbusConnectionFailed from err
201
175
  if test_connect:
202
176
  return
203
177
  # if auth is required send the auth key
@@ -208,6 +182,7 @@ class Velbus:
208
182
  await self.scan()
209
183
 
210
184
  async def scan(self) -> None:
185
+ """Scan the bus."""
211
186
  self._handler.scan_started()
212
187
  for addr in range(1, 256):
213
188
  msg = ModuleTypeRequestMessage(addr)
@@ -229,9 +204,7 @@ class Velbus:
229
204
  )
230
205
 
231
206
  async def _check_if_modules_are_loaded(self) -> None:
232
- """
233
- Task to wait until modules are loaded
234
- """
207
+ """Task to wait until modules are loaded."""
235
208
  while True:
236
209
  mods_loaded = 0
237
210
  for mod in (self.get_modules()).values():
@@ -246,9 +219,7 @@ class Velbus:
246
219
  await asyncio.sleep(15)
247
220
 
248
221
  async def send(self, msg: Message) -> None:
249
- """
250
- Send a packet
251
- """
222
+ """Send a packet."""
252
223
  await self._protocol.send_message(
253
224
  RawMessage(
254
225
  priority=msg.priority,
@@ -259,6 +230,7 @@ class Velbus:
259
230
  )
260
231
 
261
232
  def get_all(self, class_name: str) -> list[Channel]:
233
+ """Get all channels."""
262
234
  lst = []
263
235
  for addr, mod in (self.get_modules()).items():
264
236
  if addr in self._submodules:
@@ -269,9 +241,8 @@ class Velbus:
269
241
  return lst
270
242
 
271
243
  async def sync_clock(self) -> None:
272
- """
273
- This will send all the needed messages to sync the clock
274
- """
275
- await self.send(SetRealtimeClock())
276
- await self.send(SetDate())
277
- await self.send(SetDaylightSaving())
244
+ """Will send all the needed messages to sync the clock."""
245
+ lclt = time.localtime()
246
+ await self.send(SetRealtimeClock(wday=lclt[6], hour=lclt[3], min=lclt[4]))
247
+ await self.send(SetDate(day=lclt[2], mon=lclt[1], year=lclt[0]))
248
+ await self.send(SetDaylightSaving(ds=not lclt[8]))
velbusaio/handler.py CHANGED
@@ -2,14 +2,13 @@
2
2
  Velbus packet handler
3
3
  :Author maikel punie <maikel.punie@gmail.com>
4
4
  """
5
+
5
6
  from __future__ import annotations
6
7
 
7
8
  import asyncio
8
9
  import json
9
10
  import logging
10
- import re
11
11
  from typing import TYPE_CHECKING, Awaitable, Callable
12
-
13
12
  import pkg_resources
14
13
 
15
14
  from velbusaio.command_registry import commandRegistry
@@ -39,7 +38,7 @@ class PacketHandler:
39
38
  self._scan_complete = False
40
39
  self._scan_complete_event = asyncio.Event()
41
40
  with open(
42
- pkg_resources.resource_filename(__name__, "moduleprotocol/protocol.json")
41
+ pkg_resources.resource_filename(__name__, "protocol.json")
43
42
  ) as protocol_file:
44
43
  self.pdata = json.load(protocol_file)
45
44
 
@@ -105,7 +104,9 @@ class PacketHandler:
105
104
  else:
106
105
  self._log.warning(
107
106
  "NOT FOUND IN command_registry: addr={} cmd={} packet={}".format(
108
- address, command_value, ":".join(format(x, "02x") for x in data)
107
+ address,
108
+ command_value,
109
+ ":".join(format(x, "02x") for x in data),
109
110
  )
110
111
  )
111
112
  elif self._scan_complete:
@@ -118,63 +119,6 @@ class PacketHandler:
118
119
  )
119
120
  )
120
121
 
121
- # def _handle_message(self, rawMsg: RawMessage) -> None:
122
- # module_type = self._velbus.get_module(rawMsg.address).get_type()
123
- # this_msg = keys_exists(
124
- # self.pdata, "ModuleTypes", h2(module_type), "Messages", h2(rawMsg.command), "Data"
125
- # )
126
- # if this_msg and "PerByte" in this_msg:
127
- # self._per_byte(this_msg["PerByte"], rawMsg)
128
-
129
- # def _per_byte(self, cmsg, rawMsg: RawMessage) -> dict:
130
- # result = {}
131
- # byte_index = 0
132
- # for byte in rawMsg.data:
133
- # num = str(byte_index)
134
- # # only do something if its defined
135
- # if num not in cmsg:
136
- # continue
137
- # # check if we can do a binary match
138
- # for mat in cmsg[num]["Match"]:
139
- # if (
140
- # (mat.startswith("%") and re.match(mat[1:], f"{byte:08b}"))
141
- # or mat == f"{byte:08b}"
142
- # or mat == f"{byte:02x}"
143
- # ):
144
- # result = self._per_byte_handle(
145
- # result, cmsg[num]["Match"][mat], byte
146
- # )
147
- # byte_index += 1
148
- # return result
149
-
150
- # def _per_byte_handle(self, result: dict, todo: dict, byte: int) -> dict:
151
- # if "Channel" in todo:
152
- # result["Channel"] = todo["Channel"]
153
- # if "Value" in todo:
154
- # result["Value"] = todo["Value"]
155
- # if "Convert" in todo:
156
- # result["ValueList"] = []
157
- # if todo["Convert"] == "Decimal":
158
- # result["ValueList"].append(int(byte))
159
- # elif todo["Convert"] == "Counter":
160
- # result["ValueList"].append(f"{byte:02x}")
161
- # elif todo["Convert"] == "Temperature":
162
- # print("CONVERT temperature")
163
- # elif todo["Convert"] == "Divider":
164
- # bin_str = f"{byte:08b}"
165
- # chan = bin_str[6:]
166
- # val = bin_str[:5]
167
- # print(f"CONVERT Divider {chan} {val}")
168
- # elif todo["Convert"] == "Channel":
169
- # print("CONVERT Channel")
170
- # elif todo["Convert"] == "ChannelBit":
171
- # print("CONVERT ChannelBit")
172
- # elif todo["Convert"].startswith("ChannelBitStatus"):
173
- # print("CONVERT ChannelBitStatus")
174
- # else:
175
- # self._log.error("UNKNOWN convert requested: {}".format(todo["Convert"]))
176
- # return result
177
-
178
122
  async def _handle_module_type(self, msg: Message) -> None:
179
123
  """
180
124
  load the module data
velbusaio/helpers.py CHANGED
@@ -1,11 +1,12 @@
1
1
  """
2
2
  Helper functions
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  import os
7
8
  import re
8
- from typing import Any, Dict
9
+ from typing import Any
9
10
 
10
11
  from velbusaio.const import CACHEDIR
11
12
 
velbusaio/message.py CHANGED
@@ -1,10 +1,10 @@
1
1
  """
2
2
  The velbus abstract message class
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  import json
7
- from typing import Optional
8
8
 
9
9
  from velbusaio.const import PRIORITY_FIRMWARE, PRIORITY_HIGH, PRIORITY_LOW
10
10
 
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Thomas Delaet <thomas@delaet.org>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  from velbusaio.messages.blind_status import BlindStatusMessage, BlindStatusNgMessage
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Tom Dupré <gitd8400@gmail.com>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  import json
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Thomas Delaet <thomas@delaet.org>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  from velbusaio.command_registry import register
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Thomas Delaet <thomas@delaet.org>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  from velbusaio.command_registry import register
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Thomas Delaet <thomas@delaet.org>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  from velbusaio.command_registry import register
@@ -1,6 +1,7 @@
1
1
  """
2
2
  :author: Thomas Delaet <thomas@delaet.org>
3
3
  """
4
+
4
5
  from __future__ import annotations
5
6
 
6
7
  from velbusaio.command_registry import register