pyvlx 0.2.19__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.
- pyvlx-0.2.21/LICENSE +165 -0
- pyvlx-0.2.21/PKG-INFO +108 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/README.md +7 -2
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/__init__.py +3 -1
- pyvlx-0.2.21/pyvlx/api/__init__.py +23 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/activate_scene.py +12 -6
- pyvlx-0.2.21/pyvlx/api/api_event.py +70 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/command_send.py +27 -13
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/factory_default.py +12 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frame_creation.py +40 -21
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/__init__.py +21 -14
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/alias_array.py +7 -5
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame.py +8 -9
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_activate_scene.py +16 -11
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_activation_log_updated.py +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_command_send.py +45 -32
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_discover_nodes.py +9 -9
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_error_notification.py +5 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_facory_default.py +4 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_all_nodes_information.py +27 -20
- pyvlx-0.2.21/pyvlx/api/frames/frame_get_limitation.py +127 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_local_time.py +6 -5
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_network_setup.py +10 -9
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_node_information.py +27 -22
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_protocol_version.py +6 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_scene_list.py +12 -10
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_state.py +7 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_get_version.py +10 -8
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_helper.py +4 -2
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_disable_cfm.py +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_disable_req.py +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_enable_cfm.py +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_house_status_monitor_enable_req.py +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_leave_learn_state.py +7 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_node_information_changed.py +11 -8
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_node_state_position_changed_notification.py +10 -10
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_password_change.py +13 -12
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_password_enter.py +9 -8
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_reboot.py +4 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_set_node_name.py +10 -8
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/frames/frame_set_utc.py +8 -6
- pyvlx-0.2.21/pyvlx/api/frames/frame_status_request.py +212 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_all_nodes_information.py +12 -6
- pyvlx-0.2.21/pyvlx/api/get_limitation.py +64 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_local_time.py +11 -5
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_network_setup.py +10 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_node_information.py +11 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_protocol_version.py +12 -5
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_scene_list.py +12 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_state.py +12 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/get_version.py +10 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/house_status_monitor.py +12 -24
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/leave_learn_state.py +11 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/password_enter.py +10 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/reboot.py +11 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/session_id.py +2 -2
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/set_node_name.py +9 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/api/set_utc.py +9 -4
- pyvlx-0.2.21/pyvlx/api/status_request.py +48 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/config.py +16 -6
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/connection.py +46 -26
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/const.py +29 -2
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/dataobjects.py +27 -15
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/exception.py +4 -3
- pyvlx-0.2.21/pyvlx/heartbeat.py +79 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/klf200gateway.py +63 -32
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/lightening_device.py +13 -11
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/node.py +16 -9
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/node_helper.py +50 -28
- pyvlx-0.2.21/pyvlx/node_updater.py +162 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/nodes.py +19 -12
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/on_off_switch.py +13 -12
- pyvlx-0.2.21/pyvlx/opening_device.py +631 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/parameter.py +156 -137
- pyvlx-0.2.21/pyvlx/py.typed +0 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/pyvlx.py +48 -17
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/scene.py +9 -4
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/scenes.py +13 -8
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/slip.py +7 -5
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/string_helper.py +2 -2
- pyvlx-0.2.21/pyvlx.egg-info/PKG-INFO +108 -0
- pyvlx-0.2.21/pyvlx.egg-info/SOURCES.txt +167 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx.egg-info/top_level.txt +1 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/setup.cfg +1 -1
- {pyvlx-0.2.19 → pyvlx-0.2.21}/setup.py +10 -5
- pyvlx-0.2.21/test/__init__.py +1 -0
- pyvlx-0.2.21/test/alias_array_test.py +46 -0
- pyvlx-0.2.21/test/command_send_test.py +84 -0
- pyvlx-0.2.21/test/config_test.py +54 -0
- pyvlx-0.2.21/test/exception_test.py +22 -0
- pyvlx-0.2.21/test/frame_activate_scene_cfm_test.py +46 -0
- pyvlx-0.2.21/test/frame_activate_scene_req_test.py +45 -0
- pyvlx-0.2.21/test/frame_activation_log_updated_ntf_test.py +28 -0
- pyvlx-0.2.21/test/frame_command_remaining_time_notification_test.py +37 -0
- pyvlx-0.2.21/test/frame_command_run_status_notification_test.py +50 -0
- pyvlx-0.2.21/test/frame_command_send_cfm_test.py +43 -0
- pyvlx-0.2.21/test/frame_command_send_req_test.py +79 -0
- pyvlx-0.2.21/test/frame_discover_nodes_cfm_test.py +26 -0
- pyvlx-0.2.21/test/frame_discover_nodes_ntf_test.py +56 -0
- pyvlx-0.2.21/test/frame_discover_nodes_req_test.py +35 -0
- pyvlx-0.2.21/test/frame_error_test.py +30 -0
- pyvlx-0.2.21/test/frame_factory_default_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_factory_default_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_get_all_nodes_information_cfm_test.py +30 -0
- pyvlx-0.2.21/test/frame_get_all_nodes_information_finished_ntf_test.py +30 -0
- pyvlx-0.2.21/test/frame_get_all_nodes_information_ntf_test.py +126 -0
- pyvlx-0.2.21/test/frame_get_all_nodes_information_req_test.py +26 -0
- pyvlx-0.2.21/test/frame_get_limitation_status_cfm_test.py +38 -0
- pyvlx-0.2.21/test/frame_get_limitation_status_ntf_test.py +45 -0
- pyvlx-0.2.21/test/frame_get_limitation_status_req_test.py +33 -0
- pyvlx-0.2.21/test/frame_get_local_time_cfm_test.py +47 -0
- pyvlx-0.2.21/test/frame_get_local_time_req_test.py +26 -0
- pyvlx-0.2.21/test/frame_get_network_setup_cfm_test.py +40 -0
- pyvlx-0.2.21/test/frame_get_network_setup_req_test.py +26 -0
- pyvlx-0.2.21/test/frame_get_node_information_cfm_test.py +30 -0
- pyvlx-0.2.21/test/frame_get_node_information_ntf_test.py +125 -0
- pyvlx-0.2.21/test/frame_get_node_information_req_test.py +27 -0
- pyvlx-0.2.21/test/frame_get_protocol_version_cfm_test.py +36 -0
- pyvlx-0.2.21/test/frame_get_protocol_version_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_get_scene_list_cfm_test.py +27 -0
- pyvlx-0.2.21/test/frame_get_scene_list_ntf_test.py +99 -0
- pyvlx-0.2.21/test/frame_get_scene_list_req_test.py +26 -0
- pyvlx-0.2.21/test/frame_get_state_cfm_test.py +42 -0
- pyvlx-0.2.21/test/frame_get_state_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_get_version_cfm_test.py +56 -0
- pyvlx-0.2.21/test/frame_get_version_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_gw_reboot_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_gw_reboot_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_helper_test.py +32 -0
- pyvlx-0.2.21/test/frame_house_status_monitor_disable_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_house_status_monitor_disable_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_house_status_monitor_enable_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_house_status_monitor_enable_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_leave_learn_state_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_leave_learn_state_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_node_information_changed_ntf_test.py +49 -0
- pyvlx-0.2.21/test/frame_node_information_mischroe_test.py +112 -0
- pyvlx-0.2.21/test/frame_node_state_position_changed_ntf_test.py +63 -0
- pyvlx-0.2.21/test/frame_password_change_cfm_test.py +38 -0
- pyvlx-0.2.21/test/frame_password_change_ntf_test.py +56 -0
- pyvlx-0.2.21/test/frame_password_change_req_test.py +83 -0
- pyvlx-0.2.21/test/frame_password_enter_cfm_test.py +38 -0
- pyvlx-0.2.21/test/frame_password_enter_req_test.py +62 -0
- pyvlx-0.2.21/test/frame_reboot_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_reboot_req_test.py +28 -0
- pyvlx-0.2.21/test/frame_session_finished_notification_test.py +29 -0
- pyvlx-0.2.21/test/frame_set_node_name_cfm_test.py +42 -0
- pyvlx-0.2.21/test/frame_set_node_name_req_test.py +38 -0
- pyvlx-0.2.21/test/frame_set_utc_cfm_test.py +28 -0
- pyvlx-0.2.21/test/frame_set_utc_req_test.py +32 -0
- pyvlx-0.2.21/test/frame_status_request_test.py +89 -0
- pyvlx-0.2.21/test/frame_test.py +31 -0
- pyvlx-0.2.21/test/get_limitation_test.py +101 -0
- pyvlx-0.2.21/test/lightening_device_test.py +47 -0
- pyvlx-0.2.21/test/node_helper_test.py +227 -0
- pyvlx-0.2.21/test/nodes_test.py +119 -0
- pyvlx-0.2.21/test/opening_device_test.py +173 -0
- pyvlx-0.2.21/test/parameter_test.py +100 -0
- pyvlx-0.2.21/test/position_test.py +136 -0
- pyvlx-0.2.21/test/scene_test.py +24 -0
- pyvlx-0.2.21/test/scenes_test.py +93 -0
- pyvlx-0.2.21/test/session_id_test.py +20 -0
- pyvlx-0.2.21/test/slip_test.py +65 -0
- pyvlx-0.2.21/test/string_test.py +44 -0
- pyvlx-0.2.19/PKG-INFO +0 -101
- pyvlx-0.2.19/pyvlx/api/__init__.py +0 -21
- pyvlx-0.2.19/pyvlx/api/api_event.py +0 -56
- pyvlx-0.2.19/pyvlx/heartbeat.py +0 -64
- pyvlx-0.2.19/pyvlx/node_updater.py +0 -54
- pyvlx-0.2.19/pyvlx/opening_device.py +0 -295
- pyvlx-0.2.19/pyvlx.egg-info/PKG-INFO +0 -101
- pyvlx-0.2.19/pyvlx.egg-info/SOURCES.txt +0 -82
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx/log.py +0 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx.egg-info/dependency_links.txt +0 -0
- {pyvlx-0.2.19 → pyvlx-0.2.21}/pyvlx.egg-info/not-zip-safe +0 -0
- {pyvlx-0.2.19 → 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
|
+
[](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
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PyVLX - controling VELUX windows with Python
|
|
2
2
|
============================================
|
|
3
3
|
|
|
4
|
-
[](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
6
|
PyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.
|
|
7
7
|
|
|
@@ -63,13 +63,18 @@ async def main(loop):
|
|
|
63
63
|
await pyvlx.nodes['Bath'].close()
|
|
64
64
|
await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))
|
|
65
65
|
|
|
66
|
+
# Read limits of windows
|
|
67
|
+
# limit = await pyvlx.nodes['Bath'].get_limitation()
|
|
68
|
+
# limit.min_value
|
|
69
|
+
# limit.max_value
|
|
70
|
+
|
|
66
71
|
# Changing of on-off switches:
|
|
67
72
|
# await pyvlx.nodes['CoffeeMaker'].set_on()
|
|
68
73
|
# await pyvlx.nodes['CoffeeMaker'].set_off()
|
|
69
74
|
|
|
70
75
|
# You can easily rename nodes:
|
|
71
76
|
# await pyvlx.nodes["Window 10"].rename("Window 11")
|
|
72
|
-
|
|
77
|
+
|
|
73
78
|
await pyvlx.disconnect()
|
|
74
79
|
|
|
75
80
|
if __name__ == '__main__':
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"""Module for accessing KLF 200 gateway with python."""
|
|
2
2
|
|
|
3
3
|
from .exception import PyVLXException
|
|
4
|
+
from .klf200gateway import Klf200Gateway
|
|
4
5
|
from .lightening_device import Light, LighteningDevice
|
|
5
6
|
from .log import PYVLXLOG
|
|
7
|
+
from .node import Node
|
|
6
8
|
from .nodes import Nodes
|
|
9
|
+
from .on_off_switch import OnOffSwitch
|
|
7
10
|
from .opening_device import (
|
|
8
11
|
Awning, Blade, Blind, GarageDoor, Gate, OpeningDevice, RollerShutter,
|
|
9
12
|
Window)
|
|
@@ -15,4 +18,3 @@ from .parameter import (
|
|
|
15
18
|
from .pyvlx import PyVLX
|
|
16
19
|
from .scene import Scene
|
|
17
20
|
from .scenes import Scenes
|
|
18
|
-
from .klf200gateway import Klf200Gateway
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Module for all KLF 200 API frames."""
|
|
2
|
+
# flake8: noqa
|
|
3
|
+
|
|
4
|
+
from .activate_scene import ActivateScene
|
|
5
|
+
from .api_event import ApiEvent
|
|
6
|
+
from .command_send import CommandSend
|
|
7
|
+
from .factory_default import FactoryDefault
|
|
8
|
+
from .get_all_nodes_information import GetAllNodesInformation
|
|
9
|
+
from .get_local_time import (
|
|
10
|
+
FrameGetLocalTimeConfirmation, FrameGetLocalTimeRequest, GetLocalTime)
|
|
11
|
+
from .get_network_setup import GetNetworkSetup
|
|
12
|
+
from .get_node_information import GetNodeInformation
|
|
13
|
+
from .get_protocol_version import GetProtocolVersion
|
|
14
|
+
from .get_scene_list import GetSceneList
|
|
15
|
+
from .get_state import GetState
|
|
16
|
+
from .get_version import GetVersion
|
|
17
|
+
from .house_status_monitor import (
|
|
18
|
+
HouseStatusMonitorDisable, HouseStatusMonitorEnable)
|
|
19
|
+
from .leave_learn_state import LeaveLearnState
|
|
20
|
+
from .password_enter import PasswordEnter
|
|
21
|
+
from .reboot import Reboot
|
|
22
|
+
from .set_node_name import SetNodeName
|
|
23
|
+
from .set_utc import SetUTC
|
|
@@ -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,
|
|
6
|
-
FrameCommandRunStatusNotification,
|
|
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,
|
|
5
|
-
|
|
6
|
-
FrameCommandSendRequest,
|
|
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=
|
|
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
|
|
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,19 +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
|
|
5
|
+
|
|
3
6
|
from .api_event import ApiEvent
|
|
4
|
-
from .frames import
|
|
7
|
+
from .frames import (
|
|
8
|
+
FrameBase, FrameGatewayFactoryDefaultConfirmation,
|
|
9
|
+
FrameGatewayFactoryDefaultRequest)
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from pyvlx import PyVLX
|
|
5
13
|
|
|
6
14
|
|
|
7
15
|
class FactoryDefault(ApiEvent):
|
|
8
16
|
"""Class for handling Factory reset API."""
|
|
9
17
|
|
|
10
|
-
def __init__(self, pyvlx):
|
|
18
|
+
def __init__(self, pyvlx: "PyVLX"):
|
|
11
19
|
"""Initialize facotry default class."""
|
|
12
20
|
super().__init__(pyvlx=pyvlx)
|
|
13
21
|
self.pyvlx = pyvlx
|
|
14
22
|
self.success = False
|
|
15
23
|
|
|
16
|
-
async def handle_frame(self, frame):
|
|
24
|
+
async def handle_frame(self, frame: FrameBase) -> bool:
|
|
17
25
|
"""Handle incoming API frame, return True if this was the expected frame."""
|
|
18
26
|
if isinstance(frame, FrameGatewayFactoryDefaultConfirmation):
|
|
19
27
|
PYVLXLOG.warning("KLF200 is factory resetting")
|
|
@@ -21,6 +29,6 @@ class FactoryDefault(ApiEvent):
|
|
|
21
29
|
return True
|
|
22
30
|
return False
|
|
23
31
|
|
|
24
|
-
def request_frame(self):
|
|
32
|
+
def request_frame(self) -> FrameGatewayFactoryDefaultRequest:
|
|
25
33
|
"""Construct initiating frame."""
|
|
26
34
|
return FrameGatewayFactoryDefaultRequest()
|
|
@@ -1,41 +1,46 @@
|
|
|
1
1
|
"""Helper module for creating a frame out of raw data."""
|
|
2
|
-
from
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
3
4
|
from pyvlx.const import Command
|
|
5
|
+
from pyvlx.log import PYVLXLOG
|
|
6
|
+
|
|
4
7
|
from .frames import (
|
|
5
8
|
FrameActivateSceneConfirmation, FrameActivateSceneRequest,
|
|
6
|
-
FrameActivationLogUpdatedNotification,
|
|
9
|
+
FrameActivationLogUpdatedNotification, FrameBase,
|
|
7
10
|
FrameCommandRemainingTimeNotification, FrameCommandRunStatusNotification,
|
|
8
11
|
FrameCommandSendConfirmation, FrameCommandSendRequest,
|
|
9
12
|
FrameDiscoverNodesConfirmation, FrameDiscoverNodesNotification,
|
|
10
13
|
FrameDiscoverNodesRequest, FrameErrorNotification,
|
|
14
|
+
FrameGatewayFactoryDefaultConfirmation, FrameGatewayFactoryDefaultRequest,
|
|
11
15
|
FrameGatewayRebootConfirmation, FrameGatewayRebootRequest,
|
|
12
16
|
FrameGetAllNodesInformationConfirmation,
|
|
13
17
|
FrameGetAllNodesInformationFinishedNotification,
|
|
14
18
|
FrameGetAllNodesInformationNotification,
|
|
15
|
-
FrameGetAllNodesInformationRequest,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
FrameGetAllNodesInformationRequest, FrameGetLimitationStatus,
|
|
20
|
+
FrameGetLimitationStatusConfirmation, FrameGetLimitationStatusNotification,
|
|
21
|
+
FrameGetLocalTimeConfirmation, FrameGetLocalTimeRequest,
|
|
22
|
+
FrameGetNetworkSetupConfirmation, FrameGetNetworkSetupRequest,
|
|
23
|
+
FrameGetNodeInformationConfirmation, FrameGetNodeInformationNotification,
|
|
24
|
+
FrameGetNodeInformationRequest, FrameGetProtocolVersionConfirmation,
|
|
25
|
+
FrameGetProtocolVersionRequest, FrameGetSceneListConfirmation,
|
|
26
|
+
FrameGetSceneListNotification, FrameGetSceneListRequest,
|
|
27
|
+
FrameGetStateConfirmation, FrameGetStateRequest,
|
|
20
28
|
FrameGetVersionConfirmation, FrameGetVersionRequest,
|
|
21
29
|
FrameHouseStatusMonitorDisableConfirmation,
|
|
22
30
|
FrameHouseStatusMonitorDisableRequest,
|
|
23
31
|
FrameHouseStatusMonitorEnableConfirmation,
|
|
24
|
-
FrameHouseStatusMonitorEnableRequest,
|
|
25
|
-
FrameNodeInformationChangedNotification,
|
|
26
|
-
FrameNodeStatePositionChangedNotification,
|
|
32
|
+
FrameHouseStatusMonitorEnableRequest, FrameLeaveLearnStateConfirmation,
|
|
33
|
+
FrameLeaveLearnStateRequest, FrameNodeInformationChangedNotification,
|
|
34
|
+
FrameNodeStatePositionChangedNotification, FramePasswordChangeConfirmation,
|
|
35
|
+
FramePasswordChangeNotification, FramePasswordChangeRequest,
|
|
27
36
|
FramePasswordEnterConfirmation, FramePasswordEnterRequest,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
FrameSetUTCConfirmation, FrameSetUTCRequest, extract_from_frame,
|
|
33
|
-
FrameLeaveLearnStateConfirmation, FrameLeaveLearnStateRequest,
|
|
34
|
-
FrameGetLocalTimeConfirmation, FrameGetLocalTimeRequest,
|
|
35
|
-
FrameGatewayFactoryDefaultConfirmation, FrameGatewayFactoryDefaultRequest)
|
|
37
|
+
FrameSessionFinishedNotification, FrameSetNodeNameConfirmation,
|
|
38
|
+
FrameSetNodeNameRequest, FrameSetUTCConfirmation, FrameSetUTCRequest,
|
|
39
|
+
FrameStatusRequestConfirmation, FrameStatusRequestNotification,
|
|
40
|
+
FrameStatusRequestRequest, extract_from_frame)
|
|
36
41
|
|
|
37
42
|
|
|
38
|
-
def frame_from_raw(raw):
|
|
43
|
+
def frame_from_raw(raw: bytes) -> Optional[FrameBase]:
|
|
39
44
|
"""Create and return frame from raw bytes."""
|
|
40
45
|
command, payload = extract_from_frame(raw)
|
|
41
46
|
frame = create_frame(command)
|
|
@@ -51,7 +56,7 @@ def frame_from_raw(raw):
|
|
|
51
56
|
return frame
|
|
52
57
|
|
|
53
58
|
|
|
54
|
-
def create_frame(command):
|
|
59
|
+
def create_frame(command: Command) -> Optional[FrameBase]:
|
|
55
60
|
"""Create and return empty Frame from Command."""
|
|
56
61
|
# pylint: disable=too-many-branches,too-many-return-statements,too-many-statements
|
|
57
62
|
if command == Command.GW_ERROR_NTF:
|
|
@@ -151,6 +156,13 @@ def create_frame(command):
|
|
|
151
156
|
if command == Command.GW_GET_STATE_CFM:
|
|
152
157
|
return FrameGetStateConfirmation()
|
|
153
158
|
|
|
159
|
+
if command == Command.GW_GET_LIMITATION_STATUS_REQ:
|
|
160
|
+
return FrameGetLimitationStatus()
|
|
161
|
+
if command == Command.GW_GET_LIMITATION_STATUS_CFM:
|
|
162
|
+
return FrameGetLimitationStatusConfirmation()
|
|
163
|
+
if command == Command.GW_LIMITATION_STATUS_NTF:
|
|
164
|
+
return FrameGetLimitationStatusNotification()
|
|
165
|
+
|
|
154
166
|
if command == Command.GW_GET_NETWORK_SETUP_REQ:
|
|
155
167
|
return FrameGetNetworkSetupRequest()
|
|
156
168
|
if command == Command.GW_GET_NETWORK_SETUP_CFM:
|
|
@@ -177,7 +189,14 @@ def create_frame(command):
|
|
|
177
189
|
return FrameNodeStatePositionChangedNotification()
|
|
178
190
|
if command == Command.GW_LEAVE_LEARN_STATE_CFM:
|
|
179
191
|
return FrameLeaveLearnStateConfirmation()
|
|
180
|
-
if command ==
|
|
192
|
+
if command == Command.GW_LEAVE_LEARN_STATE_REQ:
|
|
181
193
|
return FrameLeaveLearnStateRequest()
|
|
182
194
|
|
|
195
|
+
if command == Command.GW_STATUS_REQUEST_REQ:
|
|
196
|
+
return FrameStatusRequestRequest()
|
|
197
|
+
if command == Command.GW_STATUS_REQUEST_CFM:
|
|
198
|
+
return FrameStatusRequestConfirmation()
|
|
199
|
+
if command == Command.GW_STATUS_REQUEST_NTF:
|
|
200
|
+
return FrameStatusRequestNotification()
|
|
201
|
+
|
|
183
202
|
return None
|