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,415 @@
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
+ "id": "segment",
110
+ "ver_code": 1
111
+ },
112
+ {
113
+ "id": "segment_effect",
114
+ "ver_code": 1
115
+ }
116
+ ]
117
+ },
118
+ "discovery_result": {
119
+ "device_id": "00000000000000000000000000000000",
120
+ "device_model": "L920-5(US)",
121
+ "device_type": "SMART.TAPOBULB",
122
+ "factory_default": false,
123
+ "ip": "127.0.0.123",
124
+ "is_support_iot_cloud": true,
125
+ "mac": "34-60-F9-00-00-00",
126
+ "mgt_encrypt_schm": {
127
+ "encrypt_type": "KLAP",
128
+ "http_port": 80,
129
+ "is_support_https": false,
130
+ "lv": 2
131
+ },
132
+ "obd_src": "tplink",
133
+ "owner": "00000000000000000000000000000000"
134
+ },
135
+ "get_antitheft_rules": {
136
+ "antitheft_rule_max_count": 1,
137
+ "enable": false,
138
+ "rule_list": []
139
+ },
140
+ "get_auto_update_info": {
141
+ "enable": true,
142
+ "random_range": 120,
143
+ "time": 180
144
+ },
145
+ "get_connect_cloud_state": {
146
+ "status": 0
147
+ },
148
+ "get_countdown_rules": {
149
+ "countdown_rule_max_count": 1,
150
+ "enable": false,
151
+ "rule_list": []
152
+ },
153
+ "get_device_info": {
154
+ "avatar": "light_strip",
155
+ "brightness": 100,
156
+ "color_temp": 0,
157
+ "color_temp_range": [
158
+ 9000,
159
+ 9000
160
+ ],
161
+ "default_states": {
162
+ "state": {
163
+ "brightness": 100,
164
+ "color_temp": 0,
165
+ "hue": 250,
166
+ "saturation": 85
167
+ },
168
+ "type": "last_states"
169
+ },
170
+ "device_id": "0000000000000000000000000000000000000000",
171
+ "device_on": false,
172
+ "fw_id": "00000000000000000000000000000000",
173
+ "fw_ver": "1.1.3 Build 231229 Rel.164316",
174
+ "has_set_location_info": false,
175
+ "hue": 250,
176
+ "hw_id": "00000000000000000000000000000000",
177
+ "hw_ver": "1.0",
178
+ "ip": "127.0.0.123",
179
+ "lang": "en_US",
180
+ "lighting_effect": {
181
+ "brightness": 50,
182
+ "custom": 0,
183
+ "display_colors": [],
184
+ "enable": 0,
185
+ "id": "",
186
+ "name": "station"
187
+ },
188
+ "mac": "34-60-F9-00-00-00",
189
+ "model": "L920",
190
+ "music_rhythm_enable": false,
191
+ "music_rhythm_mode": "single_lamp",
192
+ "nickname": "I01BU0tFRF9OQU1FIw==",
193
+ "oem_id": "00000000000000000000000000000000",
194
+ "overheated": false,
195
+ "region": "Pacific/Honolulu",
196
+ "rssi": -32,
197
+ "saturation": 85,
198
+ "segment_effect": {
199
+ "brightness": 0,
200
+ "custom": 0,
201
+ "display_colors": [],
202
+ "enable": 0,
203
+ "id": "",
204
+ "name": "station"
205
+ },
206
+ "signal_level": 3,
207
+ "specs": "",
208
+ "ssid": "I01BU0tFRF9TU0lEIw==",
209
+ "time_diff": -600,
210
+ "type": "SMART.TAPOBULB"
211
+ },
212
+ "get_device_segment": {
213
+ "segment": 50
214
+ },
215
+ "get_device_time": {
216
+ "region": "Pacific/Honolulu",
217
+ "time_diff": -600,
218
+ "timestamp": 1705991901
219
+ },
220
+ "get_device_usage": {
221
+ "power_usage": {
222
+ "past30": 8,
223
+ "past7": 7,
224
+ "today": 0
225
+ },
226
+ "saved_power": {
227
+ "past30": 110,
228
+ "past7": 101,
229
+ "today": 14
230
+ },
231
+ "time_usage": {
232
+ "past30": 118,
233
+ "past7": 108,
234
+ "today": 14
235
+ }
236
+ },
237
+ "get_fw_download_state": {
238
+ "auto_upgrade": false,
239
+ "download_progress": 0,
240
+ "reboot_time": 5,
241
+ "status": 0,
242
+ "upgrade_time": 5
243
+ },
244
+ "get_inherit_info": null,
245
+ "get_latest_fw": {
246
+ "fw_size": 0,
247
+ "fw_ver": "1.1.3 Build 231229 Rel.164316",
248
+ "hw_id": "",
249
+ "need_to_upgrade": false,
250
+ "oem_id": "",
251
+ "release_date": "",
252
+ "release_note": "",
253
+ "type": 0
254
+ },
255
+ "get_lighting_effect": {
256
+ "brightness": 50,
257
+ "custom": 0,
258
+ "direction": 1,
259
+ "display_colors": [],
260
+ "duration": 0,
261
+ "enable": 0,
262
+ "expansion_strategy": 2,
263
+ "id": "",
264
+ "name": "station",
265
+ "repeat_times": 1,
266
+ "segment_length": 1,
267
+ "sequence": [
268
+ [
269
+ 300,
270
+ 100,
271
+ 50
272
+ ],
273
+ [
274
+ 240,
275
+ 100,
276
+ 50
277
+ ],
278
+ [
279
+ 180,
280
+ 100,
281
+ 50
282
+ ],
283
+ [
284
+ 120,
285
+ 100,
286
+ 50
287
+ ],
288
+ [
289
+ 60,
290
+ 100,
291
+ 50
292
+ ],
293
+ [
294
+ 0,
295
+ 100,
296
+ 50
297
+ ],
298
+ [
299
+ 0,
300
+ 0,
301
+ 50
302
+ ],
303
+ [
304
+ 0,
305
+ 0,
306
+ 50
307
+ ],
308
+ [
309
+ 0,
310
+ 0,
311
+ 50
312
+ ],
313
+ [
314
+ 0,
315
+ 0,
316
+ 50
317
+ ],
318
+ [
319
+ 0,
320
+ 0,
321
+ 50
322
+ ],
323
+ [
324
+ 0,
325
+ 0,
326
+ 50
327
+ ]
328
+ ],
329
+ "spread": 16,
330
+ "transition": 400,
331
+ "type": "sequence"
332
+ },
333
+ "get_next_event": {},
334
+ "get_on_off_gradually_info": {
335
+ "enable": false
336
+ },
337
+ "get_preset_rules": {
338
+ "start_index": 0,
339
+ "states": [
340
+ {
341
+ "brightness": 50,
342
+ "color_temp": 9000,
343
+ "hue": 0,
344
+ "saturation": 100
345
+ },
346
+ {
347
+ "brightness": 100,
348
+ "color_temp": 0,
349
+ "hue": 240,
350
+ "saturation": 100
351
+ },
352
+ {
353
+ "brightness": 100,
354
+ "color_temp": 0,
355
+ "hue": 0,
356
+ "saturation": 100
357
+ },
358
+ {
359
+ "brightness": 100,
360
+ "color_temp": 0,
361
+ "hue": 120,
362
+ "saturation": 100
363
+ }
364
+ ],
365
+ "sum": 7
366
+ },
367
+ "get_schedule_rules": {
368
+ "enable": false,
369
+ "rule_list": [],
370
+ "schedule_rule_max_count": 24,
371
+ "start_index": 0,
372
+ "sum": 0
373
+ },
374
+ "get_segment_effect_rule": {
375
+ "brightness": 0,
376
+ "custom": 0,
377
+ "display_colors": [],
378
+ "enable": 0,
379
+ "id": "",
380
+ "name": "station"
381
+ },
382
+ "get_wireless_scan_info": {
383
+ "ap_list": [],
384
+ "wep_supported": false
385
+ },
386
+ "qs_component_nego": {
387
+ "component_list": [
388
+ {
389
+ "id": "quick_setup",
390
+ "ver_code": 3
391
+ },
392
+ {
393
+ "id": "sunrise_sunset",
394
+ "ver_code": 1
395
+ },
396
+ {
397
+ "id": "inherit",
398
+ "ver_code": 1
399
+ },
400
+ {
401
+ "id": "iot_cloud",
402
+ "ver_code": 1
403
+ },
404
+ {
405
+ "id": "firmware",
406
+ "ver_code": 2
407
+ }
408
+ ],
409
+ "extra_info": {
410
+ "device_model": "L920",
411
+ "device_type": "SMART.TAPOBULB",
412
+ "is_klap": true
413
+ }
414
+ }
415
+ }