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