conson-xp 1.2.0__py3-none-any.whl → 1.3.0__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.
- {conson_xp-1.2.0.dist-info → conson_xp-1.3.0.dist-info}/METADATA +1 -5
- {conson_xp-1.2.0.dist-info → conson_xp-1.3.0.dist-info}/RECORD +30 -47
- xp/__init__.py +1 -1
- xp/cli/commands/__init__.py +0 -2
- xp/cli/commands/conbus/conbus_actiontable_commands.py +5 -3
- xp/cli/commands/conbus/conbus_autoreport_commands.py +39 -21
- xp/cli/commands/conbus/conbus_blink_commands.py +8 -8
- xp/cli/commands/conbus/conbus_config_commands.py +3 -1
- xp/cli/commands/conbus/conbus_custom_commands.py +3 -1
- xp/cli/commands/conbus/conbus_datapoint_commands.py +4 -2
- xp/cli/commands/conbus/conbus_discover_commands.py +5 -3
- xp/cli/commands/conbus/conbus_lightlevel_commands.py +68 -32
- xp/cli/commands/conbus/conbus_linknumber_commands.py +32 -17
- xp/cli/commands/conbus/conbus_msactiontable_commands.py +11 -4
- xp/cli/commands/conbus/conbus_output_commands.py +6 -2
- xp/cli/commands/conbus/conbus_receive_commands.py +5 -3
- xp/cli/commands/file_commands.py +9 -3
- xp/cli/commands/homekit/homekit_start_commands.py +3 -1
- xp/cli/commands/module_commands.py +12 -4
- xp/cli/commands/reverse_proxy_commands.py +3 -1
- xp/cli/main.py +0 -2
- xp/models/conbus/conbus_datapoint.py +3 -0
- xp/models/conbus/conbus_writeconfig.py +60 -0
- xp/services/conbus/conbus_datapoint_service.py +9 -6
- xp/services/conbus/{conbus_linknumber_set_service.py → write_config_service.py} +78 -66
- xp/services/telegram/telegram_datapoint_service.py +70 -0
- xp/utils/dependencies.py +4 -46
- xp/api/__init__.py +0 -1
- xp/api/main.py +0 -125
- xp/api/models/__init__.py +0 -1
- xp/api/models/api.py +0 -31
- xp/api/models/discover.py +0 -31
- xp/api/routers/__init__.py +0 -17
- xp/api/routers/conbus.py +0 -5
- xp/api/routers/conbus_blink.py +0 -117
- xp/api/routers/conbus_custom.py +0 -71
- xp/api/routers/conbus_datapoint.py +0 -74
- xp/api/routers/conbus_output.py +0 -167
- xp/api/routers/errors.py +0 -38
- xp/cli/commands/api.py +0 -12
- xp/cli/commands/api_start_commands.py +0 -132
- xp/services/conbus/conbus_autoreport_get_service.py +0 -94
- xp/services/conbus/conbus_autoreport_set_service.py +0 -141
- xp/services/conbus/conbus_lightlevel_get_service.py +0 -109
- xp/services/conbus/conbus_lightlevel_set_service.py +0 -225
- xp/services/conbus/conbus_linknumber_get_service.py +0 -94
- {conson_xp-1.2.0.dist-info → conson_xp-1.3.0.dist-info}/WHEEL +0 -0
- {conson_xp-1.2.0.dist-info → conson_xp-1.3.0.dist-info}/entry_points.txt +0 -0
- {conson_xp-1.2.0.dist-info → conson_xp-1.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: conson-xp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: XP Protocol Communication Tools
|
|
5
5
|
Author-Email: ldvchosal <ldvchosal@github.com>
|
|
6
6
|
License: MIT License
|
|
@@ -272,10 +272,6 @@ src/xp/
|
|
|
272
272
|
|
|
273
273
|
xp
|
|
274
274
|
|
|
275
|
-
xp api
|
|
276
|
-
xp api start
|
|
277
|
-
|
|
278
|
-
|
|
279
275
|
xp conbus
|
|
280
276
|
|
|
281
277
|
xp conbus actiontable
|
|
@@ -1,47 +1,33 @@
|
|
|
1
|
-
conson_xp-1.
|
|
2
|
-
conson_xp-1.
|
|
3
|
-
conson_xp-1.
|
|
4
|
-
conson_xp-1.
|
|
5
|
-
xp/__init__.py,sha256=
|
|
6
|
-
xp/api/__init__.py,sha256=fCWjkuTzDlyJ8hIpU_QEBNcah3BB2bqVSfZwmP4ee5k,51
|
|
7
|
-
xp/api/main.py,sha256=Iih3u-T7eLRtQC0bUW6WH72k-kgfS8p85meXnJd9cC4,3738
|
|
8
|
-
xp/api/models/__init__.py,sha256=Xl8j2qiHc-Vb8b1ZmNZaMj7RtMvk0G_2SOvMgQumYzs,54
|
|
9
|
-
xp/api/models/api.py,sha256=nq70i1rhAntf7dUFAS4LrtEz4VNzP8Q-9AZD0tR7hTg,944
|
|
10
|
-
xp/api/models/discover.py,sha256=uKRB8JaTf1nnlgnDPtpHKYOFfTTVkG8A2GQHvoCXSEU,903
|
|
11
|
-
xp/api/routers/__init__.py,sha256=yVfLRQz6iw48vZF_i1cqTCrmy9gycmmmny6iG_1dM24,307
|
|
12
|
-
xp/api/routers/conbus.py,sha256=OUlsiAQwH5Xk38ueywvWVhD7LoTfyuUoHnqGtOF4ZCU,134
|
|
13
|
-
xp/api/routers/conbus_blink.py,sha256=sTAwYmF1Giw3ykoJT7BNzT0lr8eZ0e94_lGbQX2hqpw,3832
|
|
14
|
-
xp/api/routers/conbus_custom.py,sha256=EcnqUhVOPKCprG3PkUQQYBUI2pspNZioTqAFgltT4_o,2466
|
|
15
|
-
xp/api/routers/conbus_datapoint.py,sha256=v-czN-9e79kjZt0VsTUI2UNFwRwRE9VPHx9m1EMrTGA,2578
|
|
16
|
-
xp/api/routers/conbus_output.py,sha256=hgkwi_74kNQZGT9XHYpq6IDREXL9z8Ckz1W84ZhIzOI,5862
|
|
17
|
-
xp/api/routers/errors.py,sha256=jnZQ4fdLT6hb-PXwLphIuhpZtlBT8cViDG1q_IAmAEU,1316
|
|
1
|
+
conson_xp-1.3.0.dist-info/METADATA,sha256=vbTIsfypeY2WgsmWOGOeLT0pMaLOtQAh0PGVDTpkUzA,9274
|
|
2
|
+
conson_xp-1.3.0.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
|
3
|
+
conson_xp-1.3.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
|
|
4
|
+
conson_xp-1.3.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
|
|
5
|
+
xp/__init__.py,sha256=zgW0EVZ8tN8g8HSuCLDaoFIBrf1aZ7IwB6_185Hu2yk,180
|
|
18
6
|
xp/cli/__init__.py,sha256=QjnKB1KaI2aIyKlzrnvCwfbBuUj8HNgwNMvNJVQofbI,81
|
|
19
7
|
xp/cli/__main__.py,sha256=l2iKwMdat5rTGd3JWs-uGksnYYDDffp_Npz05QdKEeU,117
|
|
20
|
-
xp/cli/commands/__init__.py,sha256=
|
|
21
|
-
xp/cli/commands/api.py,sha256=Q7IkrVRhGK8ya2aoY0R1UvifHqwUPCnQZtAvqEDne-w,293
|
|
22
|
-
xp/cli/commands/api_start_commands.py,sha256=qs7UVFfIfgAldu-09gCRz3VAlQNApiQNLfueDXhDTvU,3449
|
|
8
|
+
xp/cli/commands/__init__.py,sha256=02CbZoKmNX-fn5etX4Hdgg2lUt1MsLFPYx2VkXZyFJ8,4394
|
|
23
9
|
xp/cli/commands/conbus/__init__.py,sha256=gE3K5OEoXkkZX8UOc2v3nreQQzwkOQi7n0VZ-Z2juXA,495
|
|
24
10
|
xp/cli/commands/conbus/conbus.py,sha256=OTebWu-V-_1tOq2nWExPLtDuAeqy7fB7ltUqzHfgcY8,2705
|
|
25
|
-
xp/cli/commands/conbus/conbus_actiontable_commands.py,sha256=
|
|
26
|
-
xp/cli/commands/conbus/conbus_autoreport_commands.py,sha256=
|
|
27
|
-
xp/cli/commands/conbus/conbus_blink_commands.py,sha256=
|
|
28
|
-
xp/cli/commands/conbus/conbus_config_commands.py,sha256=
|
|
29
|
-
xp/cli/commands/conbus/conbus_custom_commands.py,sha256=
|
|
30
|
-
xp/cli/commands/conbus/conbus_datapoint_commands.py,sha256=
|
|
31
|
-
xp/cli/commands/conbus/conbus_discover_commands.py,sha256=
|
|
32
|
-
xp/cli/commands/conbus/conbus_lightlevel_commands.py,sha256=
|
|
33
|
-
xp/cli/commands/conbus/conbus_linknumber_commands.py,sha256=
|
|
34
|
-
xp/cli/commands/conbus/conbus_msactiontable_commands.py,sha256=
|
|
35
|
-
xp/cli/commands/conbus/conbus_output_commands.py,sha256=
|
|
11
|
+
xp/cli/commands/conbus/conbus_actiontable_commands.py,sha256=H73-iHpsYRiOMl1hDILl2TaBdH3_It770bBZVZUcLyc,1978
|
|
12
|
+
xp/cli/commands/conbus/conbus_autoreport_commands.py,sha256=oZgyUUFNsb4yf2WO81l2w1PrasNwdC__QwxNkJ2jCaU,3794
|
|
13
|
+
xp/cli/commands/conbus/conbus_blink_commands.py,sha256=UK-Ey4K0FvaPQ96U0gyMid236RlBmUhPNRes9y0SlkM,4848
|
|
14
|
+
xp/cli/commands/conbus/conbus_config_commands.py,sha256=BugIbgNX6_s4MySGvI6tWZkwguciajHUX2Xz8XBux7k,716
|
|
15
|
+
xp/cli/commands/conbus/conbus_custom_commands.py,sha256=lICT93ijMdhVRm8KjNMLo7kQ2BLlnOZvMPbR3SxSmZ4,1692
|
|
16
|
+
xp/cli/commands/conbus/conbus_datapoint_commands.py,sha256=r36OuTjREtbGKL-bskAGa0-WLw7x06td6woZn3GYJNA,3630
|
|
17
|
+
xp/cli/commands/conbus/conbus_discover_commands.py,sha256=Jt-OjARc-QXCr453bhKG0zXRqvOMVKZr328zNxSDulY,1373
|
|
18
|
+
xp/cli/commands/conbus/conbus_lightlevel_commands.py,sha256=FpCwogdxa7yFUjlrxM7e8Q2Ut32tKAHabngQQChvtJI,6763
|
|
19
|
+
xp/cli/commands/conbus/conbus_linknumber_commands.py,sha256=pn491Iy_LcwZ5XLtvNTWu8qG_Vdaaxr7le1tTuVK7Qw,3392
|
|
20
|
+
xp/cli/commands/conbus/conbus_msactiontable_commands.py,sha256=kKWX9S0Ip9eX9EyWPwmyKMtt6q-jRXcOaicMAKt84Ls,2652
|
|
21
|
+
xp/cli/commands/conbus/conbus_output_commands.py,sha256=zdRVbHzVhMbZpG2x5WXtujc3wKTsoQUV4IgkVIbJbCc,5019
|
|
36
22
|
xp/cli/commands/conbus/conbus_raw_commands.py,sha256=8BKUarwvHgz-sxML7n99YVsb8B1HJNExjQpRsuY_tQw,1829
|
|
37
|
-
xp/cli/commands/conbus/conbus_receive_commands.py,sha256=
|
|
23
|
+
xp/cli/commands/conbus/conbus_receive_commands.py,sha256=WdH7fYcbjweIGxD2uxrTRD8lJzViMSVdsaHTvSDJNCQ,1757
|
|
38
24
|
xp/cli/commands/conbus/conbus_scan_commands.py,sha256=JfXucOwOadvLEKT_fW9fwvqWKHaEODOojLjnO8JV_00,1730
|
|
39
|
-
xp/cli/commands/file_commands.py,sha256=
|
|
25
|
+
xp/cli/commands/file_commands.py,sha256=GV102X7FRZDUNKLlzvSsIGcoXAaofOzmjCp3HUpE9lw,5532
|
|
40
26
|
xp/cli/commands/homekit/__init__.py,sha256=qqwY8ulxTx1S74Mzpb6EKjBLT6fWTNdf9PQ3HKuERKY,50
|
|
41
27
|
xp/cli/commands/homekit/homekit.py,sha256=fiPBlE_nSndyO1ftEyTjL6xmgTh44Q3uZJEIcsf6W9I,3594
|
|
42
|
-
xp/cli/commands/homekit/homekit_start_commands.py,sha256
|
|
43
|
-
xp/cli/commands/module_commands.py,sha256=
|
|
44
|
-
xp/cli/commands/reverse_proxy_commands.py,sha256=
|
|
28
|
+
xp/cli/commands/homekit/homekit_start_commands.py,sha256=-9vuj7NgcPNc1l6aEdiq1jO94Wa4cYjemnNSa-lMtvE,1120
|
|
29
|
+
xp/cli/commands/module_commands.py,sha256=xjRFsrNqzdSJT-YmRFqxDNJPH0kZgT-za_4vnk8ToXQ,5386
|
|
30
|
+
xp/cli/commands/reverse_proxy_commands.py,sha256=dusGISfuSVW6zdrc1-UKxnMj29dCCcRCHJxe2PRwnP0,5457
|
|
45
31
|
xp/cli/commands/server/__init__.py,sha256=iunDmcaax9U-SHymgGzUlPadGdZLFl9LlhXu2mnyb64,49
|
|
46
32
|
xp/cli/commands/server/server_commands.py,sha256=I7A8qaHL01H4JKMbaw_WTHVUCIurpZJBMR9wVJwaKhM,3877
|
|
47
33
|
xp/cli/commands/telegram/__init__.py,sha256=KPhwoU5uscHe3tFAxWXxgFV5OKi9bISBh_TSREnxBFQ,181
|
|
@@ -52,7 +38,7 @@ xp/cli/commands/telegram/telegram_discover_commands.py,sha256=0UArJinw1eWFbee5EG
|
|
|
52
38
|
xp/cli/commands/telegram/telegram_linknumber_commands.py,sha256=7j0-E5Moqqga4NrKDch82C6glaFDFMQn5_3hMwie7BQ,2511
|
|
53
39
|
xp/cli/commands/telegram/telegram_parse_commands.py,sha256=_OYOso1hS4f_ox96qlkYL2SuFnmimpAvqqdYlLzX9yo,2232
|
|
54
40
|
xp/cli/commands/telegram/telegram_version_commands.py,sha256=WQyx1-B9yJ8V9WrFyBpOvULJ-jq12GoZZDDoRbM7eyw,1553
|
|
55
|
-
xp/cli/main.py,sha256=
|
|
41
|
+
xp/cli/main.py,sha256=52nMDP2Pq-W1PP4_BU5ybyTuO6QrStWOeLr44Wl_gB8,2812
|
|
56
42
|
xp/cli/utils/__init__.py,sha256=gTGIj60Uai0iE7sr9_TtEpl04fD7krtTzbbigXUsUVU,46
|
|
57
43
|
xp/cli/utils/click_tree.py,sha256=ilmM2IMa_c-TqUMsv2alrZXuS0BNhvVlrBlSfyN8lzM,1670
|
|
58
44
|
xp/cli/utils/datapoint_type_choice.py,sha256=HcydhlqxZ7YyorEeTjFGkypF2JnYNPvOzkl1rhZ93Fc,1666
|
|
@@ -77,13 +63,14 @@ xp/models/conbus/conbus_blink.py,sha256=XEAPtA-O76ulX6Zh1oYzsWF6L4css6xJBuUTwNcD
|
|
|
77
63
|
xp/models/conbus/conbus_client_config.py,sha256=fWPmHM-OVUzSASKq667JzP7e9_Qp9ZUyYcTaijWkVlY,1484
|
|
78
64
|
xp/models/conbus/conbus_connection_status.py,sha256=iGbmtBaAMwV6UD7XG3H3tnB0fl2MR8rJhpjrLH2KjsE,1097
|
|
79
65
|
xp/models/conbus/conbus_custom.py,sha256=8H2sPR6_LIlksuOvL7-8bPkzAJLR0rpYiiwfYYFVjEo,1965
|
|
80
|
-
xp/models/conbus/conbus_datapoint.py,sha256=
|
|
66
|
+
xp/models/conbus/conbus_datapoint.py,sha256=4ncR-vB2lRzRBAA30rYn8eguyTxsZoOKrrXtjGmPpWg,3396
|
|
81
67
|
xp/models/conbus/conbus_discover.py,sha256=oYIHLLsXmgSQHrayS-JgcEpEaK_01Q1WTQEQj79h4j4,1642
|
|
82
68
|
xp/models/conbus/conbus_lightlevel.py,sha256=GQGhzrCBEJROosNHInXIzBy6MD2AskEIMoFEGgZ60-0,1695
|
|
83
69
|
xp/models/conbus/conbus_linknumber.py,sha256=uFzKzfB06oIzZEKCb5X2JEI80JjMPFuYglsT1W1k8j4,1815
|
|
84
70
|
xp/models/conbus/conbus_output.py,sha256=q7QKsD_CWT7YOk-V3otKWD1VM7qThrSLIUOunntMrMc,1953
|
|
85
71
|
xp/models/conbus/conbus_raw.py,sha256=xqvYao6IE1SXum7JBgZpSuWXm9x_QZquS9N_3_r0Hjs,1460
|
|
86
72
|
xp/models/conbus/conbus_receive.py,sha256=-1u1qK-texfKCNZV-GYf_9KyLtJdIrx7HuZsKzu26Ow,1322
|
|
73
|
+
xp/models/conbus/conbus_writeconfig.py,sha256=z8fdJeFLyGJW7UMHcHxGrHIMS6gG1D3aXeYUkBuwnEg,2136
|
|
87
74
|
xp/models/homekit/__init__.py,sha256=5HDSOClCu0ArK3IICn3_LDMMLBAzLjBxUUSF73bxSSk,34
|
|
88
75
|
xp/models/homekit/homekit_accessory.py,sha256=NsHFhskuxIdJpF9-MvXHtjkLYvNHmSGFOy0GmQv3PY4,1038
|
|
89
76
|
xp/models/homekit/homekit_config.py,sha256=Y1WwrbISRtJOkKVBnXQULb3vAOzcOdt95hBAI8cM_MU,2771
|
|
@@ -118,22 +105,17 @@ xp/services/conbus/actiontable/msactiontable_service.py,sha256=u64nejKvHzMdmlK9V
|
|
|
118
105
|
xp/services/conbus/actiontable/msactiontable_xp20_serializer.py,sha256=EYspooOdi0Z8oaXGxpazwnUoTmh-d7U9auhu11iBgmU,6527
|
|
119
106
|
xp/services/conbus/actiontable/msactiontable_xp24_serializer.py,sha256=30qsk9UKje1n32PPc4YoGV1lw_ZvgxNqqd8ZDgzMJpg,4504
|
|
120
107
|
xp/services/conbus/actiontable/msactiontable_xp33_serializer.py,sha256=nuWfka4U9W4lpTcS8uD6azXFcryPb0CUO5O7Z28G1k8,8901
|
|
121
|
-
xp/services/conbus/conbus_autoreport_get_service.py,sha256=uuMe4JAGgkJXiYozo2GRq8_jEuVkxWvg-YNhznZbIIc,3485
|
|
122
|
-
xp/services/conbus/conbus_autoreport_set_service.py,sha256=OHvMnzfSooW5wQa-KiVu9jdOpjR_O006nChJyMAuzS8,5310
|
|
123
108
|
xp/services/conbus/conbus_blink_all_service.py,sha256=OaEg4b8AEiEruHSkZ5jDtaoI81vwwxLq4KWXO7zBdD0,6582
|
|
124
109
|
xp/services/conbus/conbus_blink_service.py,sha256=x9uM-sLnIEV8wSNsvJgo08E042g-Hh2ZF3rXkz-k_9s,5824
|
|
125
110
|
xp/services/conbus/conbus_custom_service.py,sha256=4aneYdPObiZOGxPFYg5Wr70cl_xFxlQIdJBPQSa0enI,5826
|
|
126
111
|
xp/services/conbus/conbus_datapoint_queryall_service.py,sha256=p9R02cVimhdJILHQ6BoeZj8Hog4oRpqBnMo3t4R8ecY,6816
|
|
127
|
-
xp/services/conbus/conbus_datapoint_service.py,sha256=
|
|
112
|
+
xp/services/conbus/conbus_datapoint_service.py,sha256=NsqRQfNsZ4_Pbe7kcMQpUqfhVPH7H148JDWH49ExQ1E,6392
|
|
128
113
|
xp/services/conbus/conbus_discover_service.py,sha256=0rdGLZfi-gsjBeuFiUwGz0tUC85hbZUDxJ93ImBmq4U,5239
|
|
129
|
-
xp/services/conbus/conbus_lightlevel_get_service.py,sha256=A6wcA9UYIR3jq5dKf0a_WMKDkou4ydIeMJOCsxerEls,4018
|
|
130
|
-
xp/services/conbus/conbus_lightlevel_set_service.py,sha256=ufYwSc-r6Ethy1gew6QxzWa6IZmzd5iMksLsrgCGvJc,8086
|
|
131
|
-
xp/services/conbus/conbus_linknumber_get_service.py,sha256=O7Gbl8bOfldbZDoOEmeKFpXhHSkzfK0cB31Eer10E0I,3529
|
|
132
|
-
xp/services/conbus/conbus_linknumber_set_service.py,sha256=8_eQcBDSDwJB-TyggahWYtaFBufliioF-VI63JeD3ss,6786
|
|
133
114
|
xp/services/conbus/conbus_output_service.py,sha256=mHFOAPx2zo0TStZ3pokp6v94AQjIamcwZDeg5YH_-eo,7240
|
|
134
115
|
xp/services/conbus/conbus_raw_service.py,sha256=4yZLLTIAOxpgByUTWZXw1ihGa6Xtl98ckj9T7VfprDI,4335
|
|
135
116
|
xp/services/conbus/conbus_receive_service.py,sha256=frXrS0OyKKvYYQTWdma21Kd0BKw5aSuHn3ZXTTqOaj0,3953
|
|
136
117
|
xp/services/conbus/conbus_scan_service.py,sha256=43Bhj7pVDOjIS2MdlD7iDvNK7Gy5KxX1qB8hiTwY5LQ,5186
|
|
118
|
+
xp/services/conbus/write_config_service.py,sha256=qe5TwQdVnMCcJ4lCeZLADdUeoDpbEaV3XoZ19a3F_qk,7128
|
|
137
119
|
xp/services/homekit/__init__.py,sha256=xAMKmln_AmEFdOOJGKWYi96seRlKDQpKx3-hm7XbdIo,36
|
|
138
120
|
xp/services/homekit/homekit_cache_service.py,sha256=NdijyH5_iyhsTHBb-OyT8Y2xnNDj8F5MP8neoVQ26hY,11010
|
|
139
121
|
xp/services/homekit/homekit_conbus_service.py,sha256=EYhYqGISPxUB6QrMDLWRPOA4S8f9AgJf0D_BKqXlGLA,3482
|
|
@@ -167,6 +149,7 @@ xp/services/server/xp33_server_service.py,sha256=qswOUv3YS5pT6rDoony49EC-MFKJZKP
|
|
|
167
149
|
xp/services/telegram/__init__.py,sha256=kv0JgMg13Fp18WgGQpalNRAWwiWbrz18X4kZAP9xpSQ,48
|
|
168
150
|
xp/services/telegram/telegram_blink_service.py,sha256=Xctc9mCSZiiW1YTh8cA-4jlc8fTioS5OxT6ymhSqiYI,4487
|
|
169
151
|
xp/services/telegram/telegram_checksum_service.py,sha256=rp_C5PlraOOIyqZDp9XjBBNZLUeBLdQNNHVpN6D-1v8,4729
|
|
152
|
+
xp/services/telegram/telegram_datapoint_service.py,sha256=A3ERuFSWc22uJUoymH-2dWkt2_AfUvJcLQ1iy8ZbO0s,2399
|
|
170
153
|
xp/services/telegram/telegram_discover_service.py,sha256=oTpiq-yzP_UmC0xVOMMFeHO-rIlK1pF3aG-Kq4SeiBI,9025
|
|
171
154
|
xp/services/telegram/telegram_link_number_service.py,sha256=1_c-_QCRPTHYn3BmMElrBJqGG6vnoIst8CB-N42hazk,6862
|
|
172
155
|
xp/services/telegram/telegram_output_service.py,sha256=UaUv_14fR8o5K2PxQBXrCzx-Hohnk-gzbev_oLw_Clc,10799
|
|
@@ -174,8 +157,8 @@ xp/services/telegram/telegram_service.py,sha256=CQKmwV0Jmlr1WwrshaANyp_e77DjBzXz
|
|
|
174
157
|
xp/services/telegram/telegram_version_service.py,sha256=M5HdOTsLdcwo122FP-jW6R740ktLrtKf2TiMDVz23h8,10528
|
|
175
158
|
xp/utils/__init__.py,sha256=_avMF_UOkfR3tNeDIPqQ5odmbq5raKkaq1rZ9Cn1CJs,332
|
|
176
159
|
xp/utils/checksum.py,sha256=HDpiQxmdIedbCbZ4o_Box0i_Zig417BtCV_46ZyhiTk,1711
|
|
177
|
-
xp/utils/dependencies.py,sha256=
|
|
160
|
+
xp/utils/dependencies.py,sha256=4G7r0m1HY9UV4E0zLS8L-axcNiX2mM-N6OOAU8dVHVM,17740
|
|
178
161
|
xp/utils/event_helper.py,sha256=W-A_xmoXlpWZBbJH6qdaN50o3-XrwFsDgvAGMJDiAgo,1001
|
|
179
162
|
xp/utils/serialization.py,sha256=RWHHk86feaB4ZP7rjE4qOWK0900yg2joUBDkP76gfOY,4618
|
|
180
163
|
xp/utils/time_utils.py,sha256=dEyViDlAG9GWU-J3D_YVa-sGma6yiyyMTgN4h2x3PY4,3781
|
|
181
|
-
conson_xp-1.
|
|
164
|
+
conson_xp-1.3.0.dist-info/RECORD,,
|
xp/__init__.py
CHANGED
xp/cli/commands/__init__.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Command modules for XP CLI."""
|
|
2
2
|
|
|
3
3
|
# Main command groups
|
|
4
|
-
from xp.cli.commands.api_start_commands import start_api_server
|
|
5
4
|
|
|
6
5
|
# Import conbus command groups (but not 'conbus' itself to avoid module shadowing in Python 3.10)
|
|
7
6
|
from xp.cli.commands.conbus.conbus import (
|
|
@@ -100,7 +99,6 @@ __all__ = [
|
|
|
100
99
|
"linknumber",
|
|
101
100
|
"blink",
|
|
102
101
|
"checksum",
|
|
103
|
-
"start_api_server",
|
|
104
102
|
"homekit",
|
|
105
103
|
"homekit_start",
|
|
106
104
|
# Individual command functions
|
|
@@ -28,7 +28,9 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
28
28
|
ctx: Click context object.
|
|
29
29
|
serial_number: 10-digit module serial number.
|
|
30
30
|
"""
|
|
31
|
-
service =
|
|
31
|
+
service: ActionTableService = (
|
|
32
|
+
ctx.obj.get("container").get_container().resolve(ActionTableService)
|
|
33
|
+
)
|
|
32
34
|
|
|
33
35
|
def progress_callback(progress: str) -> None:
|
|
34
36
|
"""Handle progress updates during action table download.
|
|
@@ -38,7 +40,7 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
38
40
|
"""
|
|
39
41
|
click.echo(progress)
|
|
40
42
|
|
|
41
|
-
def
|
|
43
|
+
def on_finish(actiontable: ActionTable) -> None:
|
|
42
44
|
"""Handle successful completion of action table download.
|
|
43
45
|
|
|
44
46
|
Args:
|
|
@@ -62,6 +64,6 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
62
64
|
service.start(
|
|
63
65
|
serial_number=serial_number,
|
|
64
66
|
progress_callback=progress_callback,
|
|
65
|
-
finish_callback=
|
|
67
|
+
finish_callback=on_finish,
|
|
66
68
|
error_callback=error_callback,
|
|
67
69
|
)
|
|
@@ -10,11 +10,12 @@ from xp.cli.utils.decorators import (
|
|
|
10
10
|
connection_command,
|
|
11
11
|
)
|
|
12
12
|
from xp.cli.utils.serial_number_type import SERIAL
|
|
13
|
-
from xp.models
|
|
14
|
-
from xp.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
from xp.services.conbus.
|
|
13
|
+
from xp.models import ConbusDatapointResponse
|
|
14
|
+
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
15
|
+
from xp.models.telegram.datapoint_type import DataPointType
|
|
16
|
+
from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
|
|
17
|
+
from xp.services.conbus.write_config_service import WriteConfigService
|
|
18
|
+
from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
@conbus_autoreport.command("get", short_help="Get auto report status for a module")
|
|
@@ -33,21 +34,30 @@ def get_autoreport_command(ctx: Context, serial_number: str) -> None:
|
|
|
33
34
|
xp conbus autoreport get 0123450001
|
|
34
35
|
"""
|
|
35
36
|
# Get service from container
|
|
36
|
-
service = (
|
|
37
|
-
ctx.obj.get("container").get_container().resolve(
|
|
37
|
+
service: ConbusDatapointService = (
|
|
38
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
39
|
+
)
|
|
40
|
+
telegram_service: TelegramDatapointService = (
|
|
41
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
38
42
|
)
|
|
39
43
|
|
|
40
|
-
def on_finish(service_response:
|
|
44
|
+
def on_finish(service_response: ConbusDatapointResponse) -> None:
|
|
41
45
|
"""Handle successful completion of auto report status retrieval.
|
|
42
46
|
|
|
43
47
|
Args:
|
|
44
48
|
service_response: Auto report response object.
|
|
45
49
|
"""
|
|
46
|
-
|
|
50
|
+
auto_report_status = telegram_service.get_autoreport_status(
|
|
51
|
+
service_response.data_value
|
|
52
|
+
)
|
|
53
|
+
result = service_response.to_dict()
|
|
54
|
+
result["auto_report_status"] = auto_report_status
|
|
55
|
+
click.echo(json.dumps(result, indent=2))
|
|
47
56
|
|
|
48
57
|
with service:
|
|
49
|
-
service.
|
|
58
|
+
service.query_datapoint(
|
|
50
59
|
serial_number=serial_number,
|
|
60
|
+
datapoint_type=DataPointType.AUTO_REPORT_STATUS,
|
|
51
61
|
finish_callback=on_finish,
|
|
52
62
|
)
|
|
53
63
|
|
|
@@ -70,21 +80,29 @@ def set_autoreport_command(ctx: Context, serial_number: str, status: str) -> Non
|
|
|
70
80
|
xp conbus autoreport set 0123450001 on
|
|
71
81
|
xp conbus autoreport set 0123450001 off
|
|
72
82
|
"""
|
|
73
|
-
# Get service from container
|
|
74
|
-
service = (
|
|
75
|
-
ctx.obj.get("container").get_container().resolve(ConbusAutoreportSetService)
|
|
76
|
-
)
|
|
77
|
-
status_bool = status.lower() == "on"
|
|
78
83
|
|
|
79
|
-
def on_finish(
|
|
80
|
-
"""Handle successful completion of
|
|
84
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
85
|
+
"""Handle successful completion of light level on command.
|
|
81
86
|
|
|
82
87
|
Args:
|
|
83
|
-
|
|
88
|
+
response: Light level response object.
|
|
84
89
|
"""
|
|
85
|
-
click.echo(json.dumps(
|
|
90
|
+
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
91
|
+
|
|
92
|
+
service: WriteConfigService = (
|
|
93
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
94
|
+
)
|
|
95
|
+
telegram_service: TelegramDatapointService = (
|
|
96
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
97
|
+
)
|
|
98
|
+
status_value = True if status == "on" else False
|
|
99
|
+
data_value = telegram_service.get_autoreport_status_data_value(status_value)
|
|
86
100
|
|
|
87
101
|
with service:
|
|
88
|
-
service.
|
|
89
|
-
serial_number=serial_number,
|
|
102
|
+
service.write_config(
|
|
103
|
+
serial_number=serial_number,
|
|
104
|
+
datapoint_type=DataPointType.AUTO_REPORT_STATUS,
|
|
105
|
+
data_value=data_value,
|
|
106
|
+
finish_callback=on_finish,
|
|
107
|
+
timeout_seconds=0.5,
|
|
90
108
|
)
|
|
@@ -34,7 +34,7 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
34
34
|
xp conbus blink on 0012345008
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
38
38
|
"""Handle successful completion of blink on command.
|
|
39
39
|
|
|
40
40
|
Args:
|
|
@@ -46,7 +46,7 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
46
46
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
47
47
|
)
|
|
48
48
|
with service:
|
|
49
|
-
service.send_blink_telegram(serial_number, "on",
|
|
49
|
+
service.send_blink_telegram(serial_number, "on", on_finish, 0.5)
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
@conbus_blink.command("off")
|
|
@@ -66,7 +66,7 @@ def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
66
66
|
xp conbus blink off 0012345008
|
|
67
67
|
"""
|
|
68
68
|
|
|
69
|
-
def
|
|
69
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
70
70
|
"""Handle successful completion of blink off command.
|
|
71
71
|
|
|
72
72
|
Args:
|
|
@@ -78,7 +78,7 @@ def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
78
78
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
79
79
|
)
|
|
80
80
|
with service:
|
|
81
|
-
service.send_blink_telegram(serial_number, "off",
|
|
81
|
+
service.send_blink_telegram(serial_number, "off", on_finish, 0.5)
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
@conbus_blink.group("all", short_help="Control blink state for all devices")
|
|
@@ -102,7 +102,7 @@ def blink_all_off(ctx: Context) -> None:
|
|
|
102
102
|
xp conbus blink all off
|
|
103
103
|
"""
|
|
104
104
|
|
|
105
|
-
def
|
|
105
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
106
106
|
"""Handle successful completion of blink all off command.
|
|
107
107
|
|
|
108
108
|
Args:
|
|
@@ -122,7 +122,7 @@ def blink_all_off(ctx: Context) -> None:
|
|
|
122
122
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
123
123
|
)
|
|
124
124
|
with service:
|
|
125
|
-
service.send_blink_all_telegram("off", progress,
|
|
125
|
+
service.send_blink_all_telegram("off", progress, on_finish, 0.5)
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
@conbus_blink_all.command("on", short_help="Turn on blinking for all devices")
|
|
@@ -140,7 +140,7 @@ def blink_all_on(ctx: Context) -> None:
|
|
|
140
140
|
xp conbus blink all on
|
|
141
141
|
"""
|
|
142
142
|
|
|
143
|
-
def
|
|
143
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
144
144
|
"""Handle successful completion of blink all on command.
|
|
145
145
|
|
|
146
146
|
Args:
|
|
@@ -160,4 +160,4 @@ def blink_all_on(ctx: Context) -> None:
|
|
|
160
160
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
161
161
|
)
|
|
162
162
|
with service:
|
|
163
|
-
service.send_blink_all_telegram("on", progress,
|
|
163
|
+
service.send_blink_all_telegram("on", progress, on_finish, 0.5)
|
|
@@ -23,5 +23,7 @@ def show_config(ctx: Context) -> None:
|
|
|
23
23
|
\b
|
|
24
24
|
xp conbus config
|
|
25
25
|
"""
|
|
26
|
-
config =
|
|
26
|
+
config: ConbusClientConfig = (
|
|
27
|
+
ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
|
|
28
|
+
)
|
|
27
29
|
click.echo(json.dumps(config.conbus.model_dump(mode="json"), indent=2))
|
|
@@ -36,7 +36,9 @@ def send_custom_telegram(
|
|
|
36
36
|
xp conbus custom 0012345011 02 E2
|
|
37
37
|
xp conbus custom 0012345011 17 AA
|
|
38
38
|
"""
|
|
39
|
-
service =
|
|
39
|
+
service: ConbusCustomService = (
|
|
40
|
+
ctx.obj.get("container").get_container().resolve(ConbusCustomService)
|
|
41
|
+
)
|
|
40
42
|
|
|
41
43
|
def on_finish(service_response: "ConbusCustomResponse") -> None:
|
|
42
44
|
"""Handle successful completion of custom telegram.
|
|
@@ -45,7 +45,9 @@ def query_datapoint(ctx: Context, serial_number: str, datapoint: DataPointType)
|
|
|
45
45
|
xp conbus datapoint query current 0012345011
|
|
46
46
|
xp conbus datapoint query humidity 0012345011
|
|
47
47
|
"""
|
|
48
|
-
service =
|
|
48
|
+
service: ConbusDatapointService = (
|
|
49
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
50
|
+
)
|
|
49
51
|
|
|
50
52
|
def on_finish(service_response: ConbusDatapointResponse) -> None:
|
|
51
53
|
"""Handle successful completion of datapoint query.
|
|
@@ -83,7 +85,7 @@ def query_all_datapoints(ctx: Context, serial_number: str) -> None:
|
|
|
83
85
|
\b
|
|
84
86
|
xp conbus datapoint all 0123450001
|
|
85
87
|
"""
|
|
86
|
-
service = (
|
|
88
|
+
service: ConbusDatapointQueryAllService = (
|
|
87
89
|
ctx.obj.get("container").get_container().resolve(ConbusDatapointQueryAllService)
|
|
88
90
|
)
|
|
89
91
|
|
|
@@ -28,7 +28,7 @@ def send_discover_telegram(ctx: click.Context) -> None:
|
|
|
28
28
|
xp conbus discover
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def on_finish(discovered_devices: ConbusDiscoverResponse) -> None:
|
|
32
32
|
"""Handle successful completion of device discovery.
|
|
33
33
|
|
|
34
34
|
Args:
|
|
@@ -45,6 +45,8 @@ def send_discover_telegram(ctx: click.Context) -> None:
|
|
|
45
45
|
# click.echo(f"Discovered : {serial_number}")
|
|
46
46
|
pass
|
|
47
47
|
|
|
48
|
-
service =
|
|
48
|
+
service: ConbusDiscoverService = (
|
|
49
|
+
ctx.obj.get("container").get_container().resolve(ConbusDiscoverService)
|
|
50
|
+
)
|
|
49
51
|
with service:
|
|
50
|
-
service.start(progress,
|
|
52
|
+
service.start(progress, on_finish, 0.5)
|
|
@@ -7,14 +7,14 @@ import click
|
|
|
7
7
|
from xp.cli.commands.conbus.conbus import conbus_lightlevel
|
|
8
8
|
from xp.cli.utils.decorators import (
|
|
9
9
|
connection_command,
|
|
10
|
-
handle_service_errors,
|
|
11
10
|
)
|
|
12
11
|
from xp.cli.utils.serial_number_type import SERIAL
|
|
13
|
-
from xp.models
|
|
14
|
-
from xp.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
from xp.models import ConbusDatapointResponse
|
|
13
|
+
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
14
|
+
from xp.models.telegram.datapoint_type import DataPointType
|
|
15
|
+
from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
|
|
16
|
+
from xp.services.conbus.write_config_service import WriteConfigService
|
|
17
|
+
from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
@conbus_lightlevel.command("set")
|
|
@@ -23,7 +23,6 @@ from xp.services.conbus.conbus_lightlevel_set_service import (
|
|
|
23
23
|
@click.argument("level", type=click.IntRange(0, 100))
|
|
24
24
|
@click.pass_context
|
|
25
25
|
@connection_command()
|
|
26
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
27
26
|
def xp_lightlevel_set(
|
|
28
27
|
ctx: click.Context, serial_number: str, output_number: int, level: int
|
|
29
28
|
) -> None:
|
|
@@ -41,20 +40,28 @@ def xp_lightlevel_set(
|
|
|
41
40
|
xp conbus lightlevel set 0011223344 0 100 # Set output 0 to 100%
|
|
42
41
|
"""
|
|
43
42
|
|
|
44
|
-
def
|
|
45
|
-
"""Handle successful completion of light level
|
|
43
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
44
|
+
"""Handle successful completion of light level on command.
|
|
46
45
|
|
|
47
46
|
Args:
|
|
48
47
|
response: Light level response object.
|
|
49
48
|
"""
|
|
50
49
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
51
50
|
|
|
52
|
-
service = (
|
|
53
|
-
ctx.obj.get("container").get_container().resolve(
|
|
51
|
+
service: WriteConfigService = (
|
|
52
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
54
53
|
)
|
|
55
54
|
|
|
55
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
56
|
+
|
|
56
57
|
with service:
|
|
57
|
-
service.
|
|
58
|
+
service.write_config(
|
|
59
|
+
serial_number=serial_number,
|
|
60
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
61
|
+
data_value=data_value,
|
|
62
|
+
finish_callback=on_finish,
|
|
63
|
+
timeout_seconds=0.5,
|
|
64
|
+
)
|
|
58
65
|
|
|
59
66
|
|
|
60
67
|
@conbus_lightlevel.command("off")
|
|
@@ -62,7 +69,6 @@ def xp_lightlevel_set(
|
|
|
62
69
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
63
70
|
@click.pass_context
|
|
64
71
|
@connection_command()
|
|
65
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
66
72
|
def xp_lightlevel_off(
|
|
67
73
|
ctx: click.Context, serial_number: str, output_number: int
|
|
68
74
|
) -> None:
|
|
@@ -79,20 +85,29 @@ def xp_lightlevel_off(
|
|
|
79
85
|
xp conbus lightlevel off 0011223344 0 # Turn off output 0
|
|
80
86
|
"""
|
|
81
87
|
|
|
82
|
-
def
|
|
83
|
-
"""Handle successful completion of light level
|
|
88
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
89
|
+
"""Handle successful completion of light level on command.
|
|
84
90
|
|
|
85
91
|
Args:
|
|
86
92
|
response: Light level response object.
|
|
87
93
|
"""
|
|
88
94
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
89
95
|
|
|
90
|
-
service = (
|
|
91
|
-
ctx.obj.get("container").get_container().resolve(
|
|
96
|
+
service: WriteConfigService = (
|
|
97
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
92
98
|
)
|
|
93
99
|
|
|
100
|
+
level = 0
|
|
101
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
102
|
+
|
|
94
103
|
with service:
|
|
95
|
-
service.
|
|
104
|
+
service.write_config(
|
|
105
|
+
serial_number=serial_number,
|
|
106
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
107
|
+
data_value=data_value,
|
|
108
|
+
finish_callback=on_finish,
|
|
109
|
+
timeout_seconds=0.5,
|
|
110
|
+
)
|
|
96
111
|
|
|
97
112
|
|
|
98
113
|
@conbus_lightlevel.command("on")
|
|
@@ -100,7 +115,6 @@ def xp_lightlevel_off(
|
|
|
100
115
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
101
116
|
@click.pass_context
|
|
102
117
|
@connection_command()
|
|
103
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
104
118
|
def xp_lightlevel_on(
|
|
105
119
|
ctx: click.Context, serial_number: str, output_number: int
|
|
106
120
|
) -> None:
|
|
@@ -117,7 +131,7 @@ def xp_lightlevel_on(
|
|
|
117
131
|
xp conbus lightlevel on 0011223344 0 # Turn on output 0 (80%)
|
|
118
132
|
"""
|
|
119
133
|
|
|
120
|
-
def
|
|
134
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
121
135
|
"""Handle successful completion of light level on command.
|
|
122
136
|
|
|
123
137
|
Args:
|
|
@@ -125,12 +139,21 @@ def xp_lightlevel_on(
|
|
|
125
139
|
"""
|
|
126
140
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
127
141
|
|
|
128
|
-
service = (
|
|
129
|
-
ctx.obj.get("container").get_container().resolve(
|
|
142
|
+
service: WriteConfigService = (
|
|
143
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
130
144
|
)
|
|
131
145
|
|
|
146
|
+
level = 60
|
|
147
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
148
|
+
|
|
132
149
|
with service:
|
|
133
|
-
service.
|
|
150
|
+
service.write_config(
|
|
151
|
+
serial_number=serial_number,
|
|
152
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
153
|
+
data_value=data_value,
|
|
154
|
+
finish_callback=on_finish,
|
|
155
|
+
timeout_seconds=0.5,
|
|
156
|
+
)
|
|
134
157
|
|
|
135
158
|
|
|
136
159
|
@conbus_lightlevel.command("get")
|
|
@@ -138,7 +161,6 @@ def xp_lightlevel_on(
|
|
|
138
161
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
139
162
|
@click.pass_context
|
|
140
163
|
@connection_command()
|
|
141
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
142
164
|
def xp_lightlevel_get(
|
|
143
165
|
ctx: click.Context, serial_number: str, output_number: int
|
|
144
166
|
) -> None:
|
|
@@ -154,18 +176,32 @@ def xp_lightlevel_get(
|
|
|
154
176
|
xp conbus lightlevel get 0123450001 2 # Get light level for output 2
|
|
155
177
|
xp conbus lightlevel get 0011223344 0 # Get light level for output 0
|
|
156
178
|
"""
|
|
179
|
+
# Get service from container
|
|
180
|
+
service: ConbusDatapointService = (
|
|
181
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
182
|
+
)
|
|
183
|
+
telegram_service: TelegramDatapointService = (
|
|
184
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
185
|
+
)
|
|
157
186
|
|
|
158
|
-
def
|
|
187
|
+
def on_finish(service_response: "ConbusDatapointResponse") -> None:
|
|
159
188
|
"""Handle successful completion of light level get command.
|
|
160
189
|
|
|
161
190
|
Args:
|
|
162
|
-
|
|
191
|
+
service_response: Light level response object.
|
|
163
192
|
"""
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
193
|
+
lightlevel_level = telegram_service.get_lightlevel(
|
|
194
|
+
service_response.data_value, output_number
|
|
195
|
+
)
|
|
196
|
+
result = service_response.to_dict()
|
|
197
|
+
result["output_number"] = output_number
|
|
198
|
+
result["lightlevel_level"] = lightlevel_level
|
|
199
|
+
click.echo(json.dumps(result, indent=2))
|
|
169
200
|
|
|
170
201
|
with service:
|
|
171
|
-
service.
|
|
202
|
+
service.query_datapoint(
|
|
203
|
+
serial_number=serial_number,
|
|
204
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
205
|
+
finish_callback=on_finish,
|
|
206
|
+
timeout_seconds=0.5,
|
|
207
|
+
)
|