python-kasa 0.6.2.1__py3-none-any.whl → 0.7.0.dev1__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 (164) hide show
  1. kasa/__init__.py +90 -27
  2. kasa/aestransport.py +51 -34
  3. kasa/cli.py +326 -130
  4. kasa/device.py +414 -0
  5. kasa/device_factory.py +83 -44
  6. kasa/device_type.py +7 -3
  7. kasa/deviceconfig.py +16 -9
  8. kasa/discover.py +100 -81
  9. kasa/emeterstatus.py +7 -5
  10. kasa/exceptions.py +41 -26
  11. kasa/feature.py +201 -0
  12. kasa/httpclient.py +21 -14
  13. kasa/interfaces/__init__.py +16 -0
  14. kasa/interfaces/fan.py +20 -0
  15. kasa/interfaces/led.py +38 -0
  16. kasa/interfaces/light.py +138 -0
  17. kasa/interfaces/lighteffect.py +80 -0
  18. kasa/interfaces/lightpreset.py +76 -0
  19. kasa/iot/__init__.py +18 -0
  20. kasa/{effects.py → iot/effects.py} +4 -2
  21. kasa/{smartbulb.py → iot/iotbulb.py} +103 -147
  22. kasa/{smartdevice.py → iot/iotdevice.py} +176 -286
  23. kasa/{smartdimmer.py → iot/iotdimmer.py} +45 -33
  24. kasa/iot/iotlightstrip.py +71 -0
  25. kasa/{modules/module.py → iot/iotmodule.py} +22 -42
  26. kasa/iot/iotplug.py +94 -0
  27. kasa/{smartstrip.py → iot/iotstrip.py} +57 -75
  28. kasa/{modules → iot/modules}/__init__.py +10 -2
  29. kasa/{modules → iot/modules}/ambientlight.py +31 -3
  30. kasa/{modules → iot/modules}/antitheft.py +1 -0
  31. kasa/{modules → iot/modules}/cloud.py +25 -6
  32. kasa/{modules → iot/modules}/countdown.py +1 -0
  33. kasa/iot/modules/emeter.py +210 -0
  34. kasa/iot/modules/led.py +32 -0
  35. kasa/iot/modules/light.py +263 -0
  36. kasa/iot/modules/lighteffect.py +122 -0
  37. kasa/iot/modules/lightpreset.py +151 -0
  38. kasa/{modules → iot/modules}/motion.py +8 -8
  39. kasa/{modules → iot/modules}/rulemodule.py +11 -12
  40. kasa/{modules → iot/modules}/schedule.py +1 -0
  41. kasa/{modules → iot/modules}/time.py +5 -4
  42. kasa/{modules → iot/modules}/usage.py +10 -8
  43. kasa/iotprotocol.py +22 -20
  44. kasa/klaptransport.py +25 -15
  45. kasa/module.py +136 -0
  46. kasa/modulemapping.py +25 -0
  47. kasa/modulemapping.pyi +96 -0
  48. kasa/protocol.py +6 -4
  49. kasa/smart/__init__.py +6 -0
  50. kasa/smart/effects.py +429 -0
  51. kasa/smart/modules/__init__.py +57 -0
  52. kasa/smart/modules/alarm.py +142 -0
  53. kasa/smart/modules/autooff.py +96 -0
  54. kasa/smart/modules/batterysensor.py +54 -0
  55. kasa/smart/modules/brightness.py +66 -0
  56. kasa/smart/modules/childdevice.py +10 -0
  57. kasa/smart/modules/cloud.py +42 -0
  58. kasa/smart/modules/color.py +96 -0
  59. kasa/smart/modules/colortemperature.py +78 -0
  60. kasa/smart/modules/contactsensor.py +42 -0
  61. kasa/smart/modules/devicemodule.py +22 -0
  62. kasa/smart/modules/energy.py +101 -0
  63. kasa/smart/modules/fan.py +80 -0
  64. kasa/smart/modules/firmware.py +216 -0
  65. kasa/smart/modules/frostprotection.py +59 -0
  66. kasa/smart/modules/humiditysensor.py +55 -0
  67. kasa/smart/modules/led.py +49 -0
  68. kasa/smart/modules/light.py +166 -0
  69. kasa/smart/modules/lighteffect.py +115 -0
  70. kasa/smart/modules/lightpreset.py +142 -0
  71. kasa/smart/modules/lightstripeffect.py +135 -0
  72. kasa/smart/modules/lighttransition.py +183 -0
  73. kasa/smart/modules/reportmode.py +36 -0
  74. kasa/smart/modules/temperaturecontrol.py +177 -0
  75. kasa/smart/modules/temperaturesensor.py +77 -0
  76. kasa/smart/modules/time.py +57 -0
  77. kasa/smart/modules/waterleaksensor.py +66 -0
  78. kasa/smart/smartchilddevice.py +65 -0
  79. kasa/smart/smartdevice.py +653 -0
  80. kasa/smart/smartmodule.py +112 -0
  81. kasa/smartprotocol.py +107 -41
  82. kasa/tests/conftest.py +27 -562
  83. kasa/tests/device_fixtures.py +427 -0
  84. kasa/tests/discovery_fixtures.py +197 -0
  85. kasa/tests/fakeprotocol_iot.py +64 -6
  86. kasa/tests/fakeprotocol_smart.py +215 -22
  87. kasa/tests/fixtureinfo.py +154 -0
  88. kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json +221 -0
  89. kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json +547 -0
  90. kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json +391 -0
  91. kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json +1557 -0
  92. kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.4.json +899 -0
  93. kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.5.json +479 -0
  94. kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.6.json +449 -0
  95. kasa/tests/fixtures/smart/P100_1.0.0_1.1.3.json +173 -0
  96. kasa/tests/fixtures/smart/P100_1.0.0_1.4.0.json +204 -0
  97. kasa/tests/fixtures/smart/P110(EU)_1.0_1.0.7.json +566 -0
  98. kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.4.0.json +170 -0
  99. kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.8.0.json +171 -0
  100. kasa/tests/fixtures/smart/child/KE100(UK)_1.0_2.8.0.json +171 -0
  101. kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +526 -0
  102. kasa/tests/fixtures/smart/child/T300(EU)_1.0_1.7.0.json +533 -0
  103. kasa/tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json +530 -0
  104. kasa/tests/fixtures/smart/child/T315(EU)_1.0_1.7.0.json +537 -0
  105. kasa/tests/smart/__init__.py +0 -0
  106. kasa/tests/smart/features/__init__.py +0 -0
  107. kasa/tests/smart/features/test_brightness.py +55 -0
  108. kasa/tests/smart/features/test_colortemp.py +30 -0
  109. kasa/tests/smart/modules/__init__.py +0 -0
  110. kasa/tests/smart/modules/test_contact.py +28 -0
  111. kasa/tests/smart/modules/test_fan.py +79 -0
  112. kasa/tests/smart/modules/test_firmware.py +108 -0
  113. kasa/tests/smart/modules/test_humidity.py +28 -0
  114. kasa/tests/smart/modules/test_light_effect.py +41 -0
  115. kasa/tests/smart/modules/test_temperature.py +47 -0
  116. kasa/tests/smart/modules/test_temperaturecontrol.py +137 -0
  117. kasa/tests/smart/modules/test_waterleak.py +42 -0
  118. kasa/tests/test_aestransport.py +115 -23
  119. kasa/tests/test_bulb.py +116 -86
  120. kasa/tests/test_childdevice.py +19 -7
  121. kasa/tests/test_cli.py +453 -99
  122. kasa/tests/test_common_modules.py +242 -0
  123. kasa/tests/test_device.py +268 -0
  124. kasa/tests/test_device_factory.py +61 -35
  125. kasa/tests/test_device_type.py +1 -1
  126. kasa/tests/test_deviceconfig.py +2 -2
  127. kasa/tests/test_dimmer.py +42 -33
  128. kasa/tests/test_discovery.py +112 -63
  129. kasa/tests/test_emeter.py +14 -10
  130. kasa/tests/test_feature.py +205 -0
  131. kasa/tests/test_httpclient.py +9 -9
  132. kasa/tests/test_iotdevice.py +286 -0
  133. kasa/tests/test_klapprotocol.py +94 -37
  134. kasa/tests/test_lightstrip.py +24 -19
  135. kasa/tests/test_plug.py +46 -8
  136. kasa/tests/test_protocol.py +8 -10
  137. kasa/tests/test_readme_examples.py +87 -26
  138. kasa/tests/test_smartdevice.py +203 -311
  139. kasa/tests/test_smartprotocol.py +130 -25
  140. kasa/tests/test_strip.py +15 -6
  141. kasa/tests/test_usage.py +1 -1
  142. kasa/xortransport.py +15 -12
  143. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev1.dist-info}/METADATA +45 -143
  144. python_kasa-0.7.0.dev1.dist-info/RECORD +239 -0
  145. kasa/modules/emeter.py +0 -111
  146. kasa/smartlightstrip.py +0 -143
  147. kasa/smartplug.py +0 -91
  148. kasa/tapo/__init__.py +0 -7
  149. kasa/tapo/childdevice.py +0 -41
  150. kasa/tapo/tapobulb.py +0 -262
  151. kasa/tapo/tapodevice.py +0 -409
  152. kasa/tapo/tapoplug.py +0 -45
  153. kasa/tests/fixtures/HS105(US)_1.0_mocked.json +0 -47
  154. kasa/tests/fixtures/HS110(EU)_2.0_mocked.json +0 -50
  155. kasa/tests/fixtures/HS110(US)_1.0_mocked.json +0 -50
  156. kasa/tests/fixtures/HS200(US)_1.0_mocked.json +0 -47
  157. kasa/tests/fixtures/HS220(US)_1.0_mocked.json +0 -75
  158. kasa/tests/fixtures/LB100(US)_1.0_mocked.json +0 -103
  159. kasa/tests/fixtures/LB120(US)_1.0_mocked.json +0 -103
  160. kasa/tests/fixtures/LB130(US)_1.0_mocked.json +0 -104
  161. python_kasa-0.6.2.1.dist-info/RECORD +0 -167
  162. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev1.dist-info}/LICENSE +0 -0
  163. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev1.dist-info}/WHEEL +0 -0
  164. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,526 @@
1
+ {
2
+ "component_nego": {
3
+ "component_list": [
4
+ {
5
+ "id": "device",
6
+ "ver_code": 2
7
+ },
8
+ {
9
+ "id": "quick_setup",
10
+ "ver_code": 3
11
+ },
12
+ {
13
+ "id": "trigger_log",
14
+ "ver_code": 1
15
+ },
16
+ {
17
+ "id": "time",
18
+ "ver_code": 1
19
+ },
20
+ {
21
+ "id": "device_local_time",
22
+ "ver_code": 1
23
+ },
24
+ {
25
+ "id": "account",
26
+ "ver_code": 1
27
+ },
28
+ {
29
+ "id": "synchronize",
30
+ "ver_code": 1
31
+ },
32
+ {
33
+ "id": "cloud_connect",
34
+ "ver_code": 1
35
+ },
36
+ {
37
+ "id": "iot_cloud",
38
+ "ver_code": 1
39
+ },
40
+ {
41
+ "id": "firmware",
42
+ "ver_code": 1
43
+ },
44
+ {
45
+ "id": "localSmart",
46
+ "ver_code": 1
47
+ },
48
+ {
49
+ "id": "battery_detect",
50
+ "ver_code": 1
51
+ }
52
+ ]
53
+ },
54
+ "get_connect_cloud_state": {
55
+ "status": 0
56
+ },
57
+ "get_device_info": {
58
+ "at_low_battery": false,
59
+ "avatar": "sensor_t110",
60
+ "bind_count": 1,
61
+ "category": "subg.trigger.contact-sensor",
62
+ "device_id": "SCRUBBED_CHILD_DEVICE_ID_2",
63
+ "fw_ver": "1.8.0 Build 220728 Rel.160024",
64
+ "hw_id": "00000000000000000000000000000000",
65
+ "hw_ver": "1.0",
66
+ "jamming_rssi": -113,
67
+ "jamming_signal_level": 1,
68
+ "lastOnboardingTimestamp": 1714661626,
69
+ "mac": "E4FAC4000000",
70
+ "model": "T110",
71
+ "nickname": "I01BU0tFRF9OQU1FIw==",
72
+ "oem_id": "00000000000000000000000000000000",
73
+ "open": false,
74
+ "parent_device_id": "0000000000000000000000000000000000000000",
75
+ "region": "Europe/Berlin",
76
+ "report_interval": 16,
77
+ "rssi": -54,
78
+ "signal_level": 3,
79
+ "specs": "EU",
80
+ "status": "online",
81
+ "status_follow_edge": false,
82
+ "type": "SMART.TAPOSENSOR"
83
+ },
84
+ "get_fw_download_state": {
85
+ "cloud_cache_seconds": 1,
86
+ "download_progress": 30,
87
+ "reboot_time": 5,
88
+ "status": 4,
89
+ "upgrade_time": 5
90
+ },
91
+ "get_latest_fw": {
92
+ "fw_ver": "1.9.0 Build 230704 Rel.154531",
93
+ "hw_id": "00000000000000000000000000000000",
94
+ "need_to_upgrade": true,
95
+ "oem_id": "00000000000000000000000000000000",
96
+ "release_date": "2023-10-30",
97
+ "release_note": "Modifications and Bug Fixes:\n1. Reduced power consumption.\n2. Fixed some minor bugs.",
98
+ "type": 2
99
+ },
100
+ "get_temp_humidity_records": {
101
+ "local_time": 1714681046,
102
+ "past24h_humidity": [
103
+ -1000,
104
+ -1000,
105
+ -1000,
106
+ -1000,
107
+ -1000,
108
+ -1000,
109
+ -1000,
110
+ -1000,
111
+ -1000,
112
+ -1000,
113
+ -1000,
114
+ -1000,
115
+ -1000,
116
+ -1000,
117
+ -1000,
118
+ -1000,
119
+ -1000,
120
+ -1000,
121
+ -1000,
122
+ -1000,
123
+ -1000,
124
+ -1000,
125
+ -1000,
126
+ -1000,
127
+ -1000,
128
+ -1000,
129
+ -1000,
130
+ -1000,
131
+ -1000,
132
+ -1000,
133
+ -1000,
134
+ -1000,
135
+ -1000,
136
+ -1000,
137
+ -1000,
138
+ -1000,
139
+ -1000,
140
+ -1000,
141
+ -1000,
142
+ -1000,
143
+ -1000,
144
+ -1000,
145
+ -1000,
146
+ -1000,
147
+ -1000,
148
+ -1000,
149
+ -1000,
150
+ -1000,
151
+ -1000,
152
+ -1000,
153
+ -1000,
154
+ -1000,
155
+ -1000,
156
+ -1000,
157
+ -1000,
158
+ -1000,
159
+ -1000,
160
+ -1000,
161
+ -1000,
162
+ -1000,
163
+ -1000,
164
+ -1000,
165
+ -1000,
166
+ -1000,
167
+ -1000,
168
+ -1000,
169
+ -1000,
170
+ -1000,
171
+ -1000,
172
+ -1000,
173
+ -1000,
174
+ -1000,
175
+ -1000,
176
+ -1000,
177
+ -1000,
178
+ -1000,
179
+ -1000,
180
+ -1000,
181
+ -1000,
182
+ -1000,
183
+ -1000,
184
+ -1000,
185
+ -1000,
186
+ -1000,
187
+ -1000,
188
+ -1000,
189
+ -1000,
190
+ -1000,
191
+ -1000,
192
+ -1000,
193
+ -1000,
194
+ -1000,
195
+ -1000,
196
+ -1000,
197
+ -1000,
198
+ -1000
199
+ ],
200
+ "past24h_humidity_exception": [
201
+ -1000,
202
+ -1000,
203
+ -1000,
204
+ -1000,
205
+ -1000,
206
+ -1000,
207
+ -1000,
208
+ -1000,
209
+ -1000,
210
+ -1000,
211
+ -1000,
212
+ -1000,
213
+ -1000,
214
+ -1000,
215
+ -1000,
216
+ -1000,
217
+ -1000,
218
+ -1000,
219
+ -1000,
220
+ -1000,
221
+ -1000,
222
+ -1000,
223
+ -1000,
224
+ -1000,
225
+ -1000,
226
+ -1000,
227
+ -1000,
228
+ -1000,
229
+ -1000,
230
+ -1000,
231
+ -1000,
232
+ -1000,
233
+ -1000,
234
+ -1000,
235
+ -1000,
236
+ -1000,
237
+ -1000,
238
+ -1000,
239
+ -1000,
240
+ -1000,
241
+ -1000,
242
+ -1000,
243
+ -1000,
244
+ -1000,
245
+ -1000,
246
+ -1000,
247
+ -1000,
248
+ -1000,
249
+ -1000,
250
+ -1000,
251
+ -1000,
252
+ -1000,
253
+ -1000,
254
+ -1000,
255
+ -1000,
256
+ -1000,
257
+ -1000,
258
+ -1000,
259
+ -1000,
260
+ -1000,
261
+ -1000,
262
+ -1000,
263
+ -1000,
264
+ -1000,
265
+ -1000,
266
+ -1000,
267
+ -1000,
268
+ -1000,
269
+ -1000,
270
+ -1000,
271
+ -1000,
272
+ -1000,
273
+ -1000,
274
+ -1000,
275
+ -1000,
276
+ -1000,
277
+ -1000,
278
+ -1000,
279
+ -1000,
280
+ -1000,
281
+ -1000,
282
+ -1000,
283
+ -1000,
284
+ -1000,
285
+ -1000,
286
+ -1000,
287
+ -1000,
288
+ -1000,
289
+ -1000,
290
+ -1000,
291
+ -1000,
292
+ -1000,
293
+ -1000,
294
+ -1000,
295
+ -1000,
296
+ -1000
297
+ ],
298
+ "past24h_temp": [
299
+ -1000,
300
+ -1000,
301
+ -1000,
302
+ -1000,
303
+ -1000,
304
+ -1000,
305
+ -1000,
306
+ -1000,
307
+ -1000,
308
+ -1000,
309
+ -1000,
310
+ -1000,
311
+ -1000,
312
+ -1000,
313
+ -1000,
314
+ -1000,
315
+ -1000,
316
+ -1000,
317
+ -1000,
318
+ -1000,
319
+ -1000,
320
+ -1000,
321
+ -1000,
322
+ -1000,
323
+ -1000,
324
+ -1000,
325
+ -1000,
326
+ -1000,
327
+ -1000,
328
+ -1000,
329
+ -1000,
330
+ -1000,
331
+ -1000,
332
+ -1000,
333
+ -1000,
334
+ -1000,
335
+ -1000,
336
+ -1000,
337
+ -1000,
338
+ -1000,
339
+ -1000,
340
+ -1000,
341
+ -1000,
342
+ -1000,
343
+ -1000,
344
+ -1000,
345
+ -1000,
346
+ -1000,
347
+ -1000,
348
+ -1000,
349
+ -1000,
350
+ -1000,
351
+ -1000,
352
+ -1000,
353
+ -1000,
354
+ -1000,
355
+ -1000,
356
+ -1000,
357
+ -1000,
358
+ -1000,
359
+ -1000,
360
+ -1000,
361
+ -1000,
362
+ -1000,
363
+ -1000,
364
+ -1000,
365
+ -1000,
366
+ -1000,
367
+ -1000,
368
+ -1000,
369
+ -1000,
370
+ -1000,
371
+ -1000,
372
+ -1000,
373
+ -1000,
374
+ -1000,
375
+ -1000,
376
+ -1000,
377
+ -1000,
378
+ -1000,
379
+ -1000,
380
+ -1000,
381
+ -1000,
382
+ -1000,
383
+ -1000,
384
+ -1000,
385
+ -1000,
386
+ -1000,
387
+ -1000,
388
+ -1000,
389
+ -1000,
390
+ -1000,
391
+ -1000,
392
+ -1000,
393
+ -1000,
394
+ -1000
395
+ ],
396
+ "past24h_temp_exception": [
397
+ -1000,
398
+ -1000,
399
+ -1000,
400
+ -1000,
401
+ -1000,
402
+ -1000,
403
+ -1000,
404
+ -1000,
405
+ -1000,
406
+ -1000,
407
+ -1000,
408
+ -1000,
409
+ -1000,
410
+ -1000,
411
+ -1000,
412
+ -1000,
413
+ -1000,
414
+ -1000,
415
+ -1000,
416
+ -1000,
417
+ -1000,
418
+ -1000,
419
+ -1000,
420
+ -1000,
421
+ -1000,
422
+ -1000,
423
+ -1000,
424
+ -1000,
425
+ -1000,
426
+ -1000,
427
+ -1000,
428
+ -1000,
429
+ -1000,
430
+ -1000,
431
+ -1000,
432
+ -1000,
433
+ -1000,
434
+ -1000,
435
+ -1000,
436
+ -1000,
437
+ -1000,
438
+ -1000,
439
+ -1000,
440
+ -1000,
441
+ -1000,
442
+ -1000,
443
+ -1000,
444
+ -1000,
445
+ -1000,
446
+ -1000,
447
+ -1000,
448
+ -1000,
449
+ -1000,
450
+ -1000,
451
+ -1000,
452
+ -1000,
453
+ -1000,
454
+ -1000,
455
+ -1000,
456
+ -1000,
457
+ -1000,
458
+ -1000,
459
+ -1000,
460
+ -1000,
461
+ -1000,
462
+ -1000,
463
+ -1000,
464
+ -1000,
465
+ -1000,
466
+ -1000,
467
+ -1000,
468
+ -1000,
469
+ -1000,
470
+ -1000,
471
+ -1000,
472
+ -1000,
473
+ -1000,
474
+ -1000,
475
+ -1000,
476
+ -1000,
477
+ -1000,
478
+ -1000,
479
+ -1000,
480
+ -1000,
481
+ -1000,
482
+ -1000,
483
+ -1000,
484
+ -1000,
485
+ -1000,
486
+ -1000,
487
+ -1000,
488
+ -1000,
489
+ -1000,
490
+ -1000,
491
+ -1000,
492
+ -1000
493
+ ],
494
+ "temp_unit": "celsius"
495
+ },
496
+ "get_trigger_logs": {
497
+ "logs": [
498
+ {
499
+ "event": "close",
500
+ "eventId": "8140289c-c66b-bdd6-63b9-542299442299",
501
+ "id": 4,
502
+ "timestamp": 1714661714
503
+ },
504
+ {
505
+ "event": "open",
506
+ "eventId": "fb4e1439-2f2c-a5e1-c35a-9e7c0d35a1e3",
507
+ "id": 3,
508
+ "timestamp": 1714661710
509
+ },
510
+ {
511
+ "event": "close",
512
+ "eventId": "ddee7733-1180-48ac-56a3-512018048ac5",
513
+ "id": 2,
514
+ "timestamp": 1714661657
515
+ },
516
+ {
517
+ "event": "open",
518
+ "eventId": "ab80951f-da38-49f9-21c5-bf025c7b606d",
519
+ "id": 1,
520
+ "timestamp": 1714661638
521
+ }
522
+ ],
523
+ "start_id": 4,
524
+ "sum": 4
525
+ }
526
+ }