python-kasa 0.6.0.dev2__py3-none-any.whl → 0.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. kasa/__init__.py +2 -2
  2. kasa/aestransport.py +154 -101
  3. kasa/cli.py +42 -23
  4. kasa/device_factory.py +4 -3
  5. kasa/deviceconfig.py +19 -10
  6. kasa/discover.py +28 -11
  7. kasa/exceptions.py +15 -1
  8. kasa/httpclient.py +113 -0
  9. kasa/iotprotocol.py +30 -26
  10. kasa/json.py +5 -1
  11. kasa/klaptransport.py +60 -75
  12. kasa/modules/emeter.py +1 -1
  13. kasa/protocol.py +61 -16
  14. kasa/smartbulb.py +2 -2
  15. kasa/smartdevice.py +11 -7
  16. kasa/smartdimmer.py +2 -2
  17. kasa/smartlightstrip.py +2 -2
  18. kasa/smartplug.py +2 -2
  19. kasa/smartprotocol.py +16 -38
  20. kasa/smartstrip.py +2 -2
  21. kasa/tapo/tapodevice.py +19 -4
  22. kasa/tapo/tapoplug.py +2 -2
  23. kasa/tests/conftest.py +24 -8
  24. kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json +28 -0
  25. kasa/tests/fixtures/HS100(UK)_4.1_1.1.0.json +3 -3
  26. kasa/tests/fixtures/HS110(EU)_1.0_1.2.5.json +11 -23
  27. kasa/tests/fixtures/HS110(EU)_4.0_1.0.4.json +40 -0
  28. kasa/tests/fixtures/HS300(US)_2.0_1.0.12.json +90 -0
  29. kasa/tests/fixtures/KL125(US)_4.0_1.0.5.json +93 -0
  30. kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json +15 -15
  31. kasa/tests/fixtures/KL430(US)_2.0_1.0.11.json +59 -0
  32. kasa/tests/fixtures/KP105(UK)_1.0_1.0.5.json +36 -0
  33. kasa/tests/fixtures/KP105(UK)_1.0_1.0.7.json +4 -4
  34. kasa/tests/fixtures/KP115(EU)_1.0_1.0.16.json +9 -9
  35. kasa/tests/fixtures/KP115(US)_1.0_1.0.21.json +42 -0
  36. kasa/tests/fixtures/KP303(UK)_1.0_1.0.3.json +9 -25
  37. kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json +414 -0
  38. kasa/tests/fixtures/smart/L510B(EU)_3.0_1.0.5.json +263 -0
  39. kasa/tests/fixtures/smart/L510E(US)_3.0_1.0.5.json +295 -0
  40. kasa/tests/fixtures/smart/L510E(US)_3.0_1.1.2.json +267 -0
  41. kasa/tests/fixtures/smart/L530E(EU)_3.0_1.0.6.json +19 -19
  42. kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.0.json +12 -12
  43. kasa/tests/fixtures/smart/L530E(US)_2.0_1.1.0.json +439 -0
  44. kasa/tests/fixtures/smart/L900-10(EU)_1.0_1.0.17.json +10 -10
  45. kasa/tests/fixtures/smart/L900-10(US)_1.0_1.0.11.json +428 -0
  46. kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.0.17.json +98 -20
  47. kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.1.0.json +390 -0
  48. kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.0.json +397 -0
  49. kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.3.json +415 -0
  50. kasa/tests/fixtures/smart/L930-5(US)_1.0_1.1.2.json +429 -0
  51. kasa/tests/fixtures/smart/P100_1.0.0_1.3.7.json +197 -0
  52. kasa/tests/fixtures/smart/P110(EU)_1.0_1.2.3.json +28 -19
  53. kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json +31 -31
  54. kasa/tests/fixtures/smart/P125M(US)_1.0_1.1.0.json +11 -11
  55. kasa/tests/fixtures/smart/P135(US)_1.0_1.0.5.json +317 -0
  56. kasa/tests/fixtures/smart/S500D(US)_1.0_1.0.5.json +317 -0
  57. kasa/tests/fixtures/smart/S505(US)_1.0_1.0.2.json +309 -0
  58. kasa/tests/newfakes.py +3 -0
  59. kasa/tests/test_aestransport.py +110 -22
  60. kasa/tests/test_cli.py +49 -2
  61. kasa/tests/test_device_factory.py +6 -4
  62. kasa/tests/test_deviceconfig.py +24 -9
  63. kasa/tests/test_discovery.py +126 -9
  64. kasa/tests/test_httpclient.py +100 -0
  65. kasa/tests/test_klapprotocol.py +70 -23
  66. kasa/tests/test_protocol.py +76 -2
  67. kasa/tests/test_smartprotocol.py +0 -1
  68. {python_kasa-0.6.0.dev2.dist-info → python_kasa-0.6.1.dist-info}/METADATA +37 -15
  69. {python_kasa-0.6.0.dev2.dist-info → python_kasa-0.6.1.dist-info}/RECORD +72 -49
  70. {python_kasa-0.6.0.dev2.dist-info → python_kasa-0.6.1.dist-info}/LICENSE +0 -0
  71. {python_kasa-0.6.0.dev2.dist-info → python_kasa-0.6.1.dist-info}/WHEEL +0 -0
  72. {python_kasa-0.6.0.dev2.dist-info → python_kasa-0.6.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,390 @@
1
+ {
2
+ "component_nego": {
3
+ "component_list": [
4
+ {
5
+ "id": "device",
6
+ "ver_code": 2
7
+ },
8
+ {
9
+ "id": "light_strip",
10
+ "ver_code": 1
11
+ },
12
+ {
13
+ "id": "light_strip_lighting_effect",
14
+ "ver_code": 2
15
+ },
16
+ {
17
+ "id": "firmware",
18
+ "ver_code": 2
19
+ },
20
+ {
21
+ "id": "quick_setup",
22
+ "ver_code": 3
23
+ },
24
+ {
25
+ "id": "inherit",
26
+ "ver_code": 1
27
+ },
28
+ {
29
+ "id": "time",
30
+ "ver_code": 1
31
+ },
32
+ {
33
+ "id": "wireless",
34
+ "ver_code": 1
35
+ },
36
+ {
37
+ "id": "schedule",
38
+ "ver_code": 2
39
+ },
40
+ {
41
+ "id": "countdown",
42
+ "ver_code": 2
43
+ },
44
+ {
45
+ "id": "antitheft",
46
+ "ver_code": 1
47
+ },
48
+ {
49
+ "id": "account",
50
+ "ver_code": 1
51
+ },
52
+ {
53
+ "id": "synchronize",
54
+ "ver_code": 1
55
+ },
56
+ {
57
+ "id": "sunrise_sunset",
58
+ "ver_code": 1
59
+ },
60
+ {
61
+ "id": "brightness",
62
+ "ver_code": 1
63
+ },
64
+ {
65
+ "id": "cloud_connect",
66
+ "ver_code": 1
67
+ },
68
+ {
69
+ "id": "color_temperature",
70
+ "ver_code": 1
71
+ },
72
+ {
73
+ "id": "default_states",
74
+ "ver_code": 1
75
+ },
76
+ {
77
+ "id": "preset",
78
+ "ver_code": 3
79
+ },
80
+ {
81
+ "id": "color",
82
+ "ver_code": 1
83
+ },
84
+ {
85
+ "id": "on_off_gradually",
86
+ "ver_code": 1
87
+ },
88
+ {
89
+ "id": "device_local_time",
90
+ "ver_code": 1
91
+ },
92
+ {
93
+ "id": "iot_cloud",
94
+ "ver_code": 1
95
+ },
96
+ {
97
+ "id": "music_rhythm",
98
+ "ver_code": 3
99
+ },
100
+ {
101
+ "id": "bulb_quick_control",
102
+ "ver_code": 1
103
+ },
104
+ {
105
+ "id": "localSmart",
106
+ "ver_code": 1
107
+ }
108
+ ]
109
+ },
110
+ "discovery_result": {
111
+ "device_id": "00000000000000000000000000000000",
112
+ "device_model": "L900-5(EU)",
113
+ "device_type": "SMART.TAPOBULB",
114
+ "factory_default": false,
115
+ "ip": "127.0.0.123",
116
+ "is_support_iot_cloud": true,
117
+ "mac": "A8-42-A1-00-00-00",
118
+ "mgt_encrypt_schm": {
119
+ "encrypt_type": "KLAP",
120
+ "http_port": 80,
121
+ "is_support_https": false,
122
+ "lv": 2
123
+ },
124
+ "obd_src": "tplink",
125
+ "owner": "00000000000000000000000000000000"
126
+ },
127
+ "get_antitheft_rules": {
128
+ "antitheft_rule_max_count": 1,
129
+ "enable": false,
130
+ "rule_list": []
131
+ },
132
+ "get_auto_update_info": {
133
+ "enable": false,
134
+ "random_range": 120,
135
+ "time": 180
136
+ },
137
+ "get_connect_cloud_state": {
138
+ "status": 0
139
+ },
140
+ "get_countdown_rules": {
141
+ "countdown_rule_max_count": 1,
142
+ "enable": false,
143
+ "rule_list": []
144
+ },
145
+ "get_device_info": {
146
+ "avatar": "light_strip",
147
+ "brightness": 100,
148
+ "color_temp": 9000,
149
+ "color_temp_range": [
150
+ 9000,
151
+ 9000
152
+ ],
153
+ "default_states": {
154
+ "state": {
155
+ "brightness": 100,
156
+ "color_temp": 9000,
157
+ "hue": 0,
158
+ "saturation": 100
159
+ },
160
+ "type": "last_states"
161
+ },
162
+ "device_id": "0000000000000000000000000000000000000000",
163
+ "device_on": true,
164
+ "fw_id": "00000000000000000000000000000000",
165
+ "fw_ver": "1.1.0 Build 230905 Rel.184939",
166
+ "has_set_location_info": false,
167
+ "hue": 0,
168
+ "hw_id": "00000000000000000000000000000000",
169
+ "hw_ver": "1.0",
170
+ "ip": "127.0.0.123",
171
+ "lang": "",
172
+ "latitude": 0,
173
+ "lighting_effect": {
174
+ "brightness": 50,
175
+ "custom": 0,
176
+ "display_colors": [],
177
+ "enable": 0,
178
+ "id": "",
179
+ "name": "station"
180
+ },
181
+ "longitude": 0,
182
+ "mac": "A8-42-A1-00-00-00",
183
+ "model": "L900",
184
+ "music_rhythm_enable": false,
185
+ "music_rhythm_mode": "single_lamp",
186
+ "nickname": "I01BU0tFRF9OQU1FIw==",
187
+ "oem_id": "00000000000000000000000000000000",
188
+ "overheated": false,
189
+ "region": "",
190
+ "rssi": -50,
191
+ "saturation": 100,
192
+ "signal_level": 2,
193
+ "specs": "",
194
+ "ssid": "I01BU0tFRF9TU0lEIw==",
195
+ "time_diff": 60,
196
+ "type": "SMART.TAPOBULB"
197
+ },
198
+ "get_device_time": {
199
+ "region": "",
200
+ "time_diff": 60,
201
+ "timestamp": 1705796222
202
+ },
203
+ "get_device_usage": {
204
+ "power_usage": {
205
+ "past30": 0,
206
+ "past7": 0,
207
+ "today": 0
208
+ },
209
+ "saved_power": {
210
+ "past30": 2,
211
+ "past7": 2,
212
+ "today": 2
213
+ },
214
+ "time_usage": {
215
+ "past30": 2,
216
+ "past7": 2,
217
+ "today": 2
218
+ }
219
+ },
220
+ "get_fw_download_state": {
221
+ "auto_upgrade": false,
222
+ "download_progress": 0,
223
+ "reboot_time": 5,
224
+ "status": 0,
225
+ "upgrade_time": 5
226
+ },
227
+ "get_inherit_info": null,
228
+ "get_latest_fw": {
229
+ "fw_size": 0,
230
+ "fw_ver": "1.1.0 Build 230905 Rel.184939",
231
+ "hw_id": "",
232
+ "need_to_upgrade": false,
233
+ "oem_id": "",
234
+ "release_date": "",
235
+ "release_note": "",
236
+ "type": 0
237
+ },
238
+ "get_lighting_effect": {
239
+ "brightness": 50,
240
+ "custom": 0,
241
+ "direction": 1,
242
+ "display_colors": [],
243
+ "duration": 0,
244
+ "enable": 0,
245
+ "expansion_strategy": 2,
246
+ "id": "",
247
+ "name": "station",
248
+ "repeat_times": 1,
249
+ "segment_length": 1,
250
+ "sequence": [
251
+ [
252
+ 300,
253
+ 100,
254
+ 50
255
+ ],
256
+ [
257
+ 240,
258
+ 100,
259
+ 50
260
+ ],
261
+ [
262
+ 180,
263
+ 100,
264
+ 50
265
+ ],
266
+ [
267
+ 120,
268
+ 100,
269
+ 50
270
+ ],
271
+ [
272
+ 60,
273
+ 100,
274
+ 50
275
+ ],
276
+ [
277
+ 0,
278
+ 100,
279
+ 50
280
+ ],
281
+ [
282
+ 0,
283
+ 0,
284
+ 50
285
+ ],
286
+ [
287
+ 0,
288
+ 0,
289
+ 50
290
+ ],
291
+ [
292
+ 0,
293
+ 0,
294
+ 50
295
+ ],
296
+ [
297
+ 0,
298
+ 0,
299
+ 50
300
+ ],
301
+ [
302
+ 0,
303
+ 0,
304
+ 50
305
+ ],
306
+ [
307
+ 0,
308
+ 0,
309
+ 50
310
+ ]
311
+ ],
312
+ "spread": 16,
313
+ "transition": 400,
314
+ "type": "sequence"
315
+ },
316
+ "get_next_event": {},
317
+ "get_on_off_gradually_info": {
318
+ "enable": false
319
+ },
320
+ "get_preset_rules": {
321
+ "start_index": 0,
322
+ "states": [
323
+ {
324
+ "brightness": 50,
325
+ "color_temp": 9000,
326
+ "hue": 0,
327
+ "saturation": 100
328
+ },
329
+ {
330
+ "brightness": 100,
331
+ "color_temp": 0,
332
+ "hue": 240,
333
+ "saturation": 100
334
+ },
335
+ {
336
+ "brightness": 100,
337
+ "color_temp": 0,
338
+ "hue": 0,
339
+ "saturation": 100
340
+ },
341
+ {
342
+ "brightness": 100,
343
+ "color_temp": 0,
344
+ "hue": 120,
345
+ "saturation": 100
346
+ }
347
+ ],
348
+ "sum": 7
349
+ },
350
+ "get_schedule_rules": {
351
+ "enable": false,
352
+ "rule_list": [],
353
+ "schedule_rule_max_count": 16,
354
+ "start_index": 0,
355
+ "sum": 0
356
+ },
357
+ "get_wireless_scan_info": {
358
+ "ap_list": [],
359
+ "wep_supported": false
360
+ },
361
+ "qs_component_nego": {
362
+ "component_list": [
363
+ {
364
+ "id": "quick_setup",
365
+ "ver_code": 3
366
+ },
367
+ {
368
+ "id": "sunrise_sunset",
369
+ "ver_code": 1
370
+ },
371
+ {
372
+ "id": "inherit",
373
+ "ver_code": 1
374
+ },
375
+ {
376
+ "id": "iot_cloud",
377
+ "ver_code": 1
378
+ },
379
+ {
380
+ "id": "firmware",
381
+ "ver_code": 2
382
+ }
383
+ ],
384
+ "extra_info": {
385
+ "device_model": "L900",
386
+ "device_type": "SMART.TAPOBULB",
387
+ "is_klap": true
388
+ }
389
+ }
390
+ }