pyvlx 0.2.20__tar.gz → 0.2.21__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 pyvlx might be problematic. Click here for more details.

Files changed (175) hide show
  1. pyvlx-0.2.21/LICENSE +165 -0
  2. pyvlx-0.2.21/PKG-INFO +108 -0
  3. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/__init__.py +2 -0
  4. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/__init__.py +2 -1
  5. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/activate_scene.py +12 -6
  6. pyvlx-0.2.21/pyvlx/api/api_event.py +70 -0
  7. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/command_send.py +27 -13
  8. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/factory_default.py +10 -4
  9. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frame_creation.py +5 -3
  10. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/alias_array.py +7 -5
  11. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame.py +8 -9
  12. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_activate_scene.py +16 -11
  13. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_activation_log_updated.py +1 -1
  14. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_command_send.py +45 -32
  15. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_discover_nodes.py +9 -9
  16. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_error_notification.py +4 -4
  17. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_facory_default.py +4 -4
  18. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_all_nodes_information.py +24 -18
  19. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_limitation.py +35 -22
  20. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_local_time.py +5 -5
  21. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_network_setup.py +9 -9
  22. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_node_information.py +24 -20
  23. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_protocol_version.py +6 -6
  24. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_scene_list.py +12 -10
  25. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_state.py +6 -6
  26. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_version.py +10 -8
  27. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_helper.py +4 -2
  28. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_disable_cfm.py +1 -1
  29. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_disable_req.py +1 -1
  30. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_enable_cfm.py +1 -1
  31. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_enable_req.py +1 -1
  32. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_leave_learn_state.py +6 -6
  33. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_node_information_changed.py +11 -8
  34. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_node_state_position_changed_notification.py +10 -10
  35. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_password_change.py +13 -12
  36. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_password_enter.py +9 -8
  37. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_reboot.py +4 -4
  38. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_set_node_name.py +10 -8
  39. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_set_utc.py +6 -6
  40. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/frame_status_request.py +22 -23
  41. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_all_nodes_information.py +11 -6
  42. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_limitation.py +22 -13
  43. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_local_time.py +11 -5
  44. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_network_setup.py +9 -4
  45. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_node_information.py +11 -6
  46. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_protocol_version.py +11 -5
  47. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_scene_list.py +11 -6
  48. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_state.py +12 -6
  49. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/get_version.py +10 -4
  50. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/house_status_monitor.py +11 -24
  51. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/leave_learn_state.py +10 -5
  52. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/password_enter.py +9 -4
  53. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/reboot.py +10 -4
  54. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/session_id.py +2 -2
  55. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/set_node_name.py +9 -4
  56. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/set_utc.py +8 -4
  57. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/status_request.py +11 -6
  58. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/config.py +15 -5
  59. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/connection.py +46 -25
  60. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/const.py +20 -2
  61. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/dataobjects.py +26 -14
  62. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/exception.py +4 -3
  63. pyvlx-0.2.21/pyvlx/heartbeat.py +79 -0
  64. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/klf200gateway.py +54 -25
  65. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/lightening_device.py +13 -11
  66. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/node.py +16 -9
  67. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/node_helper.py +28 -4
  68. pyvlx-0.2.21/pyvlx/node_updater.py +162 -0
  69. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/nodes.py +18 -11
  70. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/on_off_switch.py +13 -12
  71. pyvlx-0.2.21/pyvlx/opening_device.py +631 -0
  72. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/parameter.py +145 -129
  73. pyvlx-0.2.21/pyvlx/py.typed +0 -0
  74. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/pyvlx.py +44 -19
  75. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/scene.py +9 -4
  76. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/scenes.py +13 -8
  77. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/slip.py +7 -5
  78. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/string_helper.py +2 -2
  79. pyvlx-0.2.21/pyvlx.egg-info/PKG-INFO +108 -0
  80. pyvlx-0.2.21/pyvlx.egg-info/SOURCES.txt +167 -0
  81. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx.egg-info/top_level.txt +1 -0
  82. {pyvlx-0.2.20 → pyvlx-0.2.21}/setup.cfg +1 -1
  83. {pyvlx-0.2.20 → pyvlx-0.2.21}/setup.py +9 -4
  84. pyvlx-0.2.21/test/__init__.py +1 -0
  85. pyvlx-0.2.21/test/alias_array_test.py +46 -0
  86. pyvlx-0.2.21/test/command_send_test.py +84 -0
  87. pyvlx-0.2.21/test/config_test.py +54 -0
  88. pyvlx-0.2.21/test/exception_test.py +22 -0
  89. pyvlx-0.2.21/test/frame_activate_scene_cfm_test.py +46 -0
  90. pyvlx-0.2.21/test/frame_activate_scene_req_test.py +45 -0
  91. pyvlx-0.2.21/test/frame_activation_log_updated_ntf_test.py +28 -0
  92. pyvlx-0.2.21/test/frame_command_remaining_time_notification_test.py +37 -0
  93. pyvlx-0.2.21/test/frame_command_run_status_notification_test.py +50 -0
  94. pyvlx-0.2.21/test/frame_command_send_cfm_test.py +43 -0
  95. pyvlx-0.2.21/test/frame_command_send_req_test.py +79 -0
  96. pyvlx-0.2.21/test/frame_discover_nodes_cfm_test.py +26 -0
  97. pyvlx-0.2.21/test/frame_discover_nodes_ntf_test.py +56 -0
  98. pyvlx-0.2.21/test/frame_discover_nodes_req_test.py +35 -0
  99. pyvlx-0.2.21/test/frame_error_test.py +30 -0
  100. pyvlx-0.2.21/test/frame_factory_default_cfm_test.py +28 -0
  101. pyvlx-0.2.21/test/frame_factory_default_req_test.py +28 -0
  102. pyvlx-0.2.21/test/frame_get_all_nodes_information_cfm_test.py +30 -0
  103. pyvlx-0.2.21/test/frame_get_all_nodes_information_finished_ntf_test.py +30 -0
  104. pyvlx-0.2.21/test/frame_get_all_nodes_information_ntf_test.py +126 -0
  105. pyvlx-0.2.21/test/frame_get_all_nodes_information_req_test.py +26 -0
  106. pyvlx-0.2.21/test/frame_get_limitation_status_cfm_test.py +38 -0
  107. pyvlx-0.2.21/test/frame_get_limitation_status_ntf_test.py +45 -0
  108. pyvlx-0.2.21/test/frame_get_limitation_status_req_test.py +33 -0
  109. pyvlx-0.2.21/test/frame_get_local_time_cfm_test.py +47 -0
  110. pyvlx-0.2.21/test/frame_get_local_time_req_test.py +26 -0
  111. pyvlx-0.2.21/test/frame_get_network_setup_cfm_test.py +40 -0
  112. pyvlx-0.2.21/test/frame_get_network_setup_req_test.py +26 -0
  113. pyvlx-0.2.21/test/frame_get_node_information_cfm_test.py +30 -0
  114. pyvlx-0.2.21/test/frame_get_node_information_ntf_test.py +125 -0
  115. pyvlx-0.2.21/test/frame_get_node_information_req_test.py +27 -0
  116. pyvlx-0.2.21/test/frame_get_protocol_version_cfm_test.py +36 -0
  117. pyvlx-0.2.21/test/frame_get_protocol_version_req_test.py +28 -0
  118. pyvlx-0.2.21/test/frame_get_scene_list_cfm_test.py +27 -0
  119. pyvlx-0.2.21/test/frame_get_scene_list_ntf_test.py +99 -0
  120. pyvlx-0.2.21/test/frame_get_scene_list_req_test.py +26 -0
  121. pyvlx-0.2.21/test/frame_get_state_cfm_test.py +42 -0
  122. pyvlx-0.2.21/test/frame_get_state_req_test.py +28 -0
  123. pyvlx-0.2.21/test/frame_get_version_cfm_test.py +56 -0
  124. pyvlx-0.2.21/test/frame_get_version_req_test.py +28 -0
  125. pyvlx-0.2.21/test/frame_gw_reboot_cfm_test.py +28 -0
  126. pyvlx-0.2.21/test/frame_gw_reboot_req_test.py +28 -0
  127. pyvlx-0.2.21/test/frame_helper_test.py +32 -0
  128. pyvlx-0.2.21/test/frame_house_status_monitor_disable_cfm_test.py +28 -0
  129. pyvlx-0.2.21/test/frame_house_status_monitor_disable_req_test.py +28 -0
  130. pyvlx-0.2.21/test/frame_house_status_monitor_enable_cfm_test.py +28 -0
  131. pyvlx-0.2.21/test/frame_house_status_monitor_enable_req_test.py +28 -0
  132. pyvlx-0.2.21/test/frame_leave_learn_state_cfm_test.py +28 -0
  133. pyvlx-0.2.21/test/frame_leave_learn_state_req_test.py +28 -0
  134. pyvlx-0.2.21/test/frame_node_information_changed_ntf_test.py +49 -0
  135. pyvlx-0.2.21/test/frame_node_information_mischroe_test.py +112 -0
  136. pyvlx-0.2.21/test/frame_node_state_position_changed_ntf_test.py +63 -0
  137. pyvlx-0.2.21/test/frame_password_change_cfm_test.py +38 -0
  138. pyvlx-0.2.21/test/frame_password_change_ntf_test.py +56 -0
  139. pyvlx-0.2.21/test/frame_password_change_req_test.py +83 -0
  140. pyvlx-0.2.21/test/frame_password_enter_cfm_test.py +38 -0
  141. pyvlx-0.2.21/test/frame_password_enter_req_test.py +62 -0
  142. pyvlx-0.2.21/test/frame_reboot_cfm_test.py +28 -0
  143. pyvlx-0.2.21/test/frame_reboot_req_test.py +28 -0
  144. pyvlx-0.2.21/test/frame_session_finished_notification_test.py +29 -0
  145. pyvlx-0.2.21/test/frame_set_node_name_cfm_test.py +42 -0
  146. pyvlx-0.2.21/test/frame_set_node_name_req_test.py +38 -0
  147. pyvlx-0.2.21/test/frame_set_utc_cfm_test.py +28 -0
  148. pyvlx-0.2.21/test/frame_set_utc_req_test.py +32 -0
  149. pyvlx-0.2.21/test/frame_status_request_test.py +89 -0
  150. pyvlx-0.2.21/test/frame_test.py +31 -0
  151. pyvlx-0.2.21/test/get_limitation_test.py +101 -0
  152. pyvlx-0.2.21/test/lightening_device_test.py +47 -0
  153. pyvlx-0.2.21/test/node_helper_test.py +227 -0
  154. pyvlx-0.2.21/test/nodes_test.py +119 -0
  155. pyvlx-0.2.21/test/opening_device_test.py +173 -0
  156. pyvlx-0.2.21/test/parameter_test.py +100 -0
  157. pyvlx-0.2.21/test/position_test.py +136 -0
  158. pyvlx-0.2.21/test/scene_test.py +24 -0
  159. pyvlx-0.2.21/test/scenes_test.py +93 -0
  160. pyvlx-0.2.21/test/session_id_test.py +20 -0
  161. pyvlx-0.2.21/test/slip_test.py +65 -0
  162. pyvlx-0.2.21/test/string_test.py +44 -0
  163. pyvlx-0.2.20/PKG-INFO +0 -106
  164. pyvlx-0.2.20/pyvlx/api/api_event.py +0 -56
  165. pyvlx-0.2.20/pyvlx/heartbeat.py +0 -78
  166. pyvlx-0.2.20/pyvlx/node_updater.py +0 -81
  167. pyvlx-0.2.20/pyvlx/opening_device.py +0 -335
  168. pyvlx-0.2.20/pyvlx.egg-info/PKG-INFO +0 -106
  169. pyvlx-0.2.20/pyvlx.egg-info/SOURCES.txt +0 -86
  170. {pyvlx-0.2.20 → pyvlx-0.2.21}/README.md +0 -0
  171. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/api/frames/__init__.py +0 -0
  172. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx/log.py +0 -0
  173. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx.egg-info/dependency_links.txt +0 -0
  174. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx.egg-info/not-zip-safe +0 -0
  175. {pyvlx-0.2.20 → pyvlx-0.2.21}/pyvlx.egg-info/requires.txt +0 -0
pyvlx-0.2.21/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
pyvlx-0.2.21/PKG-INFO ADDED
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyvlx
3
+ Version: 0.2.21
4
+ Summary: PyVLX is a wrapper for the Velux KLF 200 API. PyVLX enables you to run scenes and or open and close velux windows.
5
+ Home-page: https://github.com/Julius2342/pyvlx
6
+ Download-URL: https://github.com/Julius2342/pyvlx/archive/0.2.21.zip
7
+ Author: Julius Mittenzwei
8
+ Author-email: julius@mittenzwei.com
9
+ License: LGPL
10
+ Keywords: velux KLF 200 home automation
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
15
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+
23
+ PyVLX - controling VELUX windows with Python
24
+ ============================================
25
+
26
+ [![CI](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml/badge.svg)](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)
27
+
28
+ PyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.
29
+
30
+ Installation
31
+ ------------
32
+
33
+ PyVLX can be installed via:
34
+
35
+ ```bash
36
+ pip3 install pyvlx
37
+ ```
38
+
39
+ Home Assistant Plugin
40
+ ---------------------
41
+
42
+ PyVLX is used within [Home Assistant](https://www.home-assistant.io/components/velux/). To enable it add the following lines to your ~/.homeassistant/configuration.yml:
43
+
44
+ ```yaml
45
+ velux:
46
+ host: "192.168.0.0"
47
+ password: "1ADwl48dka"
48
+ ```
49
+
50
+ *Please note that this uses the WiFi password, not the web login.*
51
+
52
+ For debugging frames add:
53
+
54
+ ```yaml
55
+ logger:
56
+ default: warning
57
+ logs:
58
+ homeassistant.components.velux: debug
59
+ pyvlx: debug
60
+ ```
61
+
62
+
63
+ Basic Operations
64
+ ----------------
65
+
66
+ ```python
67
+ """Just a demo of the new PyVLX module."""
68
+ import asyncio
69
+ from pyvlx import PyVLX, Position
70
+
71
+
72
+ async def main(loop):
73
+ """Demonstrate functionality of PyVLX."""
74
+ pyvlx = PyVLX('pyvlx.yaml', loop=loop)
75
+ # Alternative:
76
+ # pyvlx = PyVLX(host="192.168.2.127", password="velux123", loop=loop)
77
+
78
+ # Runing scenes:
79
+ await pyvlx.load_scenes()
80
+ await pyvlx.scenes["All Windows Closed"].run()
81
+
82
+ # Changing position of windows:
83
+ await pyvlx.load_nodes()
84
+ await pyvlx.nodes['Bath'].open()
85
+ await pyvlx.nodes['Bath'].close()
86
+ await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))
87
+
88
+ # Read limits of windows
89
+ # limit = await pyvlx.nodes['Bath'].get_limitation()
90
+ # limit.min_value
91
+ # limit.max_value
92
+
93
+ # Changing of on-off switches:
94
+ # await pyvlx.nodes['CoffeeMaker'].set_on()
95
+ # await pyvlx.nodes['CoffeeMaker'].set_off()
96
+
97
+ # You can easily rename nodes:
98
+ # await pyvlx.nodes["Window 10"].rename("Window 11")
99
+
100
+ await pyvlx.disconnect()
101
+
102
+ if __name__ == '__main__':
103
+ # pylint: disable=invalid-name
104
+ LOOP = asyncio.get_event_loop()
105
+ LOOP.run_until_complete(main(LOOP))
106
+ # LOOP.run_forever()
107
+ LOOP.close()
108
+ ```
@@ -4,7 +4,9 @@ from .exception import PyVLXException
4
4
  from .klf200gateway import Klf200Gateway
5
5
  from .lightening_device import Light, LighteningDevice
6
6
  from .log import PYVLXLOG
7
+ from .node import Node
7
8
  from .nodes import Nodes
9
+ from .on_off_switch import OnOffSwitch
8
10
  from .opening_device import (
9
11
  Awning, Blade, Blind, GarageDoor, Gate, OpeningDevice, RollerShutter,
10
12
  Window)
@@ -2,6 +2,7 @@
2
2
  # flake8: noqa
3
3
 
4
4
  from .activate_scene import ActivateScene
5
+ from .api_event import ApiEvent
5
6
  from .command_send import CommandSend
6
7
  from .factory_default import FactoryDefault
7
8
  from .get_all_nodes_information import GetAllNodesInformation
@@ -14,7 +15,7 @@ from .get_scene_list import GetSceneList
14
15
  from .get_state import GetState
15
16
  from .get_version import GetVersion
16
17
  from .house_status_monitor import (
17
- house_status_monitor_disable, house_status_monitor_enable)
18
+ HouseStatusMonitorDisable, HouseStatusMonitorEnable)
18
19
  from .leave_learn_state import LeaveLearnState
19
20
  from .password_enter import PasswordEnter
20
21
  from .reboot import Reboot
@@ -1,26 +1,32 @@
1
1
  """Module for retrieving scene list from API."""
2
+ from typing import TYPE_CHECKING, Optional
3
+
2
4
  from .api_event import ApiEvent
3
5
  from .frames import (
4
6
  ActivateSceneConfirmationStatus, FrameActivateSceneConfirmation,
5
- FrameActivateSceneRequest, FrameCommandRemainingTimeNotification,
6
- FrameCommandRunStatusNotification, FrameSessionFinishedNotification)
7
+ FrameActivateSceneRequest, FrameBase,
8
+ FrameCommandRemainingTimeNotification, FrameCommandRunStatusNotification,
9
+ FrameSessionFinishedNotification)
7
10
  from .session_id import get_new_session_id
8
11
 
12
+ if TYPE_CHECKING:
13
+ from pyvlx import PyVLX
14
+
9
15
 
10
16
  class ActivateScene(ApiEvent):
11
17
  """Class for activating scene via API."""
12
18
 
13
19
  def __init__(
14
- self, pyvlx, scene_id, wait_for_completion=True, timeout_in_seconds=60
20
+ self, pyvlx: "PyVLX", scene_id: int, wait_for_completion: bool = True, timeout_in_seconds: int = 60
15
21
  ):
16
22
  """Initialize SceneList class."""
17
23
  super().__init__(pyvlx=pyvlx, timeout_in_seconds=timeout_in_seconds)
18
24
  self.success = False
19
25
  self.scene_id = scene_id
20
26
  self.wait_for_completion = wait_for_completion
21
- self.session_id = None
27
+ self.session_id: Optional[int] = None
22
28
 
23
- async def handle_frame(self, frame):
29
+ async def handle_frame(self, frame: FrameBase) -> bool:
24
30
  """Handle incoming API frame, return True if this was the expected frame."""
25
31
  if (
26
32
  isinstance(frame, FrameActivateSceneConfirmation)
@@ -49,7 +55,7 @@ class ActivateScene(ApiEvent):
49
55
  return True
50
56
  return False
51
57
 
52
- def request_frame(self):
58
+ def request_frame(self) -> FrameActivateSceneRequest:
53
59
  """Construct initiating frame."""
54
60
  self.session_id = get_new_session_id()
55
61
  return FrameActivateSceneRequest(
@@ -0,0 +1,70 @@
1
+ """Base class for waiting for a specific answer frame from velux ap.."""
2
+ import asyncio
3
+ from typing import TYPE_CHECKING, Optional
4
+
5
+ from .frames import FrameBase
6
+
7
+ if TYPE_CHECKING:
8
+ from pyvlx import PyVLX
9
+
10
+
11
+ class ApiEvent:
12
+ """Base class for waiting a specific frame from API connection."""
13
+
14
+ def __init__(self, pyvlx: "PyVLX", timeout_in_seconds: int = 10):
15
+ """Initialize ApiEvent."""
16
+ self.pyvlx = pyvlx
17
+ self.response_received_or_timeout = asyncio.Event()
18
+
19
+ self.success = False
20
+ self.timeout_in_seconds = timeout_in_seconds
21
+ self.timeout_callback = None
22
+ self.timeout_handle: Optional[asyncio.TimerHandle] = None
23
+
24
+ async def do_api_call(self) -> None:
25
+ """Start. Sending and waiting for answer."""
26
+ # We check for connection before entering the semaphore section
27
+ # because otherwise we might try to connect, which calls this, and we get stuck on
28
+ # the semaphore.
29
+ await self.pyvlx.check_connected()
30
+
31
+ async with self.pyvlx.api_call_semaphore:
32
+ self.pyvlx.connection.register_frame_received_cb(self.response_rec_callback)
33
+ await self.send_frame()
34
+ await self.start_timeout()
35
+ await self.response_received_or_timeout.wait()
36
+ self.response_received_or_timeout.clear()
37
+ await self.stop_timeout()
38
+ self.pyvlx.connection.unregister_frame_received_cb(self.response_rec_callback)
39
+
40
+ async def handle_frame(self, frame: FrameBase) -> bool:
41
+ """Handle incoming API frame, return True if this was the expected frame."""
42
+ raise NotImplementedError("handle_frame has to be implemented")
43
+
44
+ async def send_frame(self) -> None:
45
+ """Send frame to API connection."""
46
+ await self.pyvlx.send_frame(self.request_frame())
47
+
48
+ def request_frame(self) -> FrameBase:
49
+ """Construct initiating frame."""
50
+ raise NotImplementedError("send_frame has to be implemented")
51
+
52
+ async def response_rec_callback(self, frame: FrameBase) -> None:
53
+ """Handle frame. Callback from internal api connection."""
54
+ if await self.handle_frame(frame):
55
+ self.response_received_or_timeout.set()
56
+
57
+ def timeout(self) -> None:
58
+ """Handle timeout for not having received expected frame."""
59
+ self.response_received_or_timeout.set()
60
+
61
+ async def start_timeout(self) -> None:
62
+ """Start timeout."""
63
+ self.timeout_handle = self.pyvlx.connection.loop.call_later(
64
+ self.timeout_in_seconds, self.timeout
65
+ )
66
+
67
+ async def stop_timeout(self) -> None:
68
+ """Stop timeout."""
69
+ if self.timeout_handle is not None:
70
+ self.timeout_handle.cancel()
@@ -1,24 +1,32 @@
1
1
  """Module for retrieving scene list from API."""
2
+ from typing import TYPE_CHECKING, Any, Optional
3
+
4
+ from ..exception import PyVLXException
5
+ from ..parameter import Parameter
2
6
  from .api_event import ApiEvent
3
7
  from .frames import (
4
- CommandSendConfirmationStatus, FrameCommandRemainingTimeNotification,
5
- FrameCommandRunStatusNotification, FrameCommandSendConfirmation,
6
- FrameCommandSendRequest, FrameSessionFinishedNotification)
8
+ CommandSendConfirmationStatus, FrameBase,
9
+ FrameCommandRemainingTimeNotification, FrameCommandRunStatusNotification,
10
+ FrameCommandSendConfirmation, FrameCommandSendRequest,
11
+ FrameSessionFinishedNotification)
7
12
  from .session_id import get_new_session_id
8
13
 
14
+ if TYPE_CHECKING:
15
+ from pyvlx import PyVLX
16
+
9
17
 
10
18
  class CommandSend(ApiEvent):
11
19
  """Class for sending command to API."""
12
20
 
13
21
  def __init__(
14
22
  self,
15
- pyvlx,
16
- node_id,
17
- parameter,
18
- active_parameter=0,
19
- wait_for_completion=True,
20
- timeout_in_seconds=60,
21
- **functional_parameter
23
+ pyvlx: "PyVLX",
24
+ node_id: int,
25
+ parameter: Parameter,
26
+ active_parameter: int = 0,
27
+ wait_for_completion: bool = True,
28
+ timeout_in_seconds: int = 2,
29
+ **functional_parameter: Any
22
30
  ):
23
31
  """Initialize SceneList class."""
24
32
  super().__init__(pyvlx=pyvlx, timeout_in_seconds=timeout_in_seconds)
@@ -28,9 +36,9 @@ class CommandSend(ApiEvent):
28
36
  self.active_parameter = active_parameter
29
37
  self.functional_parameter = functional_parameter
30
38
  self.wait_for_completion = wait_for_completion
31
- self.session_id = None
39
+ self.session_id: Optional[int] = None
32
40
 
33
- async def handle_frame(self, frame):
41
+ async def handle_frame(self, frame: FrameBase) -> bool:
34
42
  """Handle incoming API frame, return True if this was the expected frame."""
35
43
  if (
36
44
  isinstance(frame, FrameCommandSendConfirmation)
@@ -59,7 +67,13 @@ class CommandSend(ApiEvent):
59
67
  return True
60
68
  return False
61
69
 
62
- def request_frame(self):
70
+ async def send(self) -> None:
71
+ """Send frame to KLF200."""
72
+ await self.do_api_call()
73
+ if not self.success:
74
+ raise PyVLXException("Unable to send command")
75
+
76
+ def request_frame(self) -> FrameCommandSendRequest:
63
77
  """Construct initiating frame."""
64
78
  self.session_id = get_new_session_id()
65
79
  return FrameCommandSendRequest(
@@ -1,21 +1,27 @@
1
1
  """Module for handling the FactoryDefault to API."""
2
+ from typing import TYPE_CHECKING
3
+
2
4
  from pyvlx.log import PYVLXLOG
3
5
 
4
6
  from .api_event import ApiEvent
5
7
  from .frames import (
6
- FrameGatewayFactoryDefaultConfirmation, FrameGatewayFactoryDefaultRequest)
8
+ FrameBase, FrameGatewayFactoryDefaultConfirmation,
9
+ FrameGatewayFactoryDefaultRequest)
10
+
11
+ if TYPE_CHECKING:
12
+ from pyvlx import PyVLX
7
13
 
8
14
 
9
15
  class FactoryDefault(ApiEvent):
10
16
  """Class for handling Factory reset API."""
11
17
 
12
- def __init__(self, pyvlx):
18
+ def __init__(self, pyvlx: "PyVLX"):
13
19
  """Initialize facotry default class."""
14
20
  super().__init__(pyvlx=pyvlx)
15
21
  self.pyvlx = pyvlx
16
22
  self.success = False
17
23
 
18
- async def handle_frame(self, frame):
24
+ async def handle_frame(self, frame: FrameBase) -> bool:
19
25
  """Handle incoming API frame, return True if this was the expected frame."""
20
26
  if isinstance(frame, FrameGatewayFactoryDefaultConfirmation):
21
27
  PYVLXLOG.warning("KLF200 is factory resetting")
@@ -23,6 +29,6 @@ class FactoryDefault(ApiEvent):
23
29
  return True
24
30
  return False
25
31
 
26
- def request_frame(self):
32
+ def request_frame(self) -> FrameGatewayFactoryDefaultRequest:
27
33
  """Construct initiating frame."""
28
34
  return FrameGatewayFactoryDefaultRequest()
@@ -1,10 +1,12 @@
1
1
  """Helper module for creating a frame out of raw data."""
2
+ from typing import Optional
3
+
2
4
  from pyvlx.const import Command
3
5
  from pyvlx.log import PYVLXLOG
4
6
 
5
7
  from .frames import (
6
8
  FrameActivateSceneConfirmation, FrameActivateSceneRequest,
7
- FrameActivationLogUpdatedNotification,
9
+ FrameActivationLogUpdatedNotification, FrameBase,
8
10
  FrameCommandRemainingTimeNotification, FrameCommandRunStatusNotification,
9
11
  FrameCommandSendConfirmation, FrameCommandSendRequest,
10
12
  FrameDiscoverNodesConfirmation, FrameDiscoverNodesNotification,
@@ -38,7 +40,7 @@ from .frames import (
38
40
  FrameStatusRequestRequest, extract_from_frame)
39
41
 
40
42
 
41
- def frame_from_raw(raw):
43
+ def frame_from_raw(raw: bytes) -> Optional[FrameBase]:
42
44
  """Create and return frame from raw bytes."""
43
45
  command, payload = extract_from_frame(raw)
44
46
  frame = create_frame(command)
@@ -54,7 +56,7 @@ def frame_from_raw(raw):
54
56
  return frame
55
57
 
56
58
 
57
- def create_frame(command):
59
+ def create_frame(command: Command) -> Optional[FrameBase]:
58
60
  """Create and return empty Frame from Command."""
59
61
  # pylint: disable=too-many-branches,too-many-return-statements,too-many-statements
60
62
  if command == Command.GW_ERROR_NTF:
@@ -1,24 +1,26 @@
1
1
  """Module for storing alias array."""
2
+ from typing import List, Optional, Tuple
3
+
2
4
  from pyvlx.exception import PyVLXException
3
5
 
4
6
 
5
7
  class AliasArray:
6
8
  """Object for storing alias array."""
7
9
 
8
- def __init__(self, raw=None):
10
+ def __init__(self, raw: Optional[bytes] = None):
9
11
  """Initialize alias array."""
10
- self.alias_array_ = []
12
+ self.alias_array_: List[Tuple[bytes, bytes]] = []
11
13
  if raw is not None:
12
14
  self.parse_raw(raw)
13
15
 
14
- def __str__(self):
16
+ def __str__(self) -> str:
15
17
  """Return human readable string."""
16
18
  return ", ".join(
17
19
  "{:02x}{:02x}={:02x}{:02x}".format(c[0][0], c[0][1], c[1][0], c[1][1])
18
20
  for c in self.alias_array_
19
21
  )
20
22
 
21
- def __bytes__(self):
23
+ def __bytes__(self) -> bytes:
22
24
  """Get raw bytes of alias array."""
23
25
  ret = bytes([len(self.alias_array_)])
24
26
  for alias in self.alias_array_:
@@ -26,7 +28,7 @@ class AliasArray:
26
28
  ret += bytes((5 - len(self.alias_array_)) * 4)
27
29
  return ret
28
30
 
29
- def parse_raw(self, raw):
31
+ def parse_raw(self, raw: bytes) -> None:
30
32
  """Parse alias array from raw bytes."""
31
33
  if not isinstance(raw, bytes):
32
34
  raise PyVLXException("AliasArray::invalid_type_if_raw", type_raw=type(raw))
@@ -1,6 +1,7 @@
1
1
  """Module for Frames."""
2
2
  import struct
3
3
 
4
+ from pyvlx.const import Command
4
5
  from pyvlx.exception import PyVLXException
5
6
 
6
7
  from .frame_helper import calc_crc
@@ -9,17 +10,17 @@ from .frame_helper import calc_crc
9
10
  class FrameBase:
10
11
  """Class for Base Frame."""
11
12
 
12
- def __init__(self, command):
13
+ def __init__(self, command: Command):
13
14
  """Initialize Base Frame."""
14
15
  self.command = command
15
16
 
16
- def __bytes__(self):
17
+ def __bytes__(self) -> bytes:
17
18
  """Get raw bytes of Frame."""
18
19
  payload = self.get_payload()
19
20
  self.validate_payload_len(payload)
20
21
  return self.build_frame(self.command, payload)
21
22
 
22
- def validate_payload_len(self, payload):
23
+ def validate_payload_len(self, payload: bytes) -> None:
23
24
  """Validate payload len."""
24
25
  if not hasattr(self, "PAYLOAD_LEN"):
25
26
  # No fixed payload len, e.g. within FrameGetSceneListNotification
@@ -33,21 +34,19 @@ class FrameBase:
33
34
  frame_type=type(self).__name__,
34
35
  )
35
36
 
36
- def get_payload(self):
37
+ def get_payload(self) -> bytes:
37
38
  """Return Payload."""
38
- # pylint: disable=no-self-use
39
39
  return b""
40
40
 
41
- def from_payload(self, payload):
41
+ def from_payload(self, payload: bytes) -> None:
42
42
  """Init frame from binary data."""
43
- # pylint: disable=no-self-use
44
43
 
45
- def __str__(self):
44
+ def __str__(self) -> str:
46
45
  """Return human readable string."""
47
46
  return "<{}/>".format(type(self).__name__)
48
47
 
49
48
  @staticmethod
50
- def build_frame(command, payload):
49
+ def build_frame(command: Command, payload: bytes) -> bytes:
51
50
  """Build raw bytes from command and payload."""
52
51
  packet_length = 2 + len(payload) + 1
53
52
  ret = struct.pack("BB", 0, packet_length)