python-kasa 0.6.2.1__py3-none-any.whl → 0.7.0.dev0__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 +88 -27
  2. kasa/aestransport.py +51 -34
  3. kasa/cli.py +326 -130
  4. kasa/device.py +406 -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 +133 -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} +100 -147
  22. kasa/{smartdevice.py → iot/iotdevice.py} +157 -286
  23. kasa/{smartdimmer.py → iot/iotdimmer.py} +42 -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 +221 -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 +139 -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 +115 -85
  120. kasa/tests/test_childdevice.py +19 -7
  121. kasa/tests/test_cli.py +453 -99
  122. kasa/tests/test_common_modules.py +216 -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 +33 -24
  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.dev0.dist-info}/METADATA +45 -143
  144. python_kasa-0.7.0.dev0.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.dev0.dist-info}/LICENSE +0 -0
  163. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev0.dist-info}/WHEEL +0 -0
  164. {python_kasa-0.6.2.1.dist-info → python_kasa-0.7.0.dev0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,530 @@
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
+ "id": "temperature",
54
+ "ver_code": 1
55
+ },
56
+ {
57
+ "id": "humidity",
58
+ "ver_code": 1
59
+ },
60
+ {
61
+ "id": "temp_humidity_record",
62
+ "ver_code": 1
63
+ },
64
+ {
65
+ "id": "comfort_temperature",
66
+ "ver_code": 1
67
+ },
68
+ {
69
+ "id": "comfort_humidity",
70
+ "ver_code": 1
71
+ },
72
+ {
73
+ "id": "report_mode",
74
+ "ver_code": 1
75
+ }
76
+ ]
77
+ },
78
+ "get_connect_cloud_state": {
79
+ "status": 0
80
+ },
81
+ "get_device_info": {
82
+ "at_low_battery": false,
83
+ "avatar": "sensor_t310",
84
+ "bind_count": 1,
85
+ "category": "subg.trigger.temp-hmdt-sensor",
86
+ "current_humidity": 54,
87
+ "current_humidity_exception": 0,
88
+ "current_temp": 19.3,
89
+ "current_temp_exception": 0,
90
+ "device_id": "SCRUBBED_CHILD_DEVICE_ID_10",
91
+ "fw_ver": "1.5.0 Build 230105 Rel.150707",
92
+ "hw_id": "00000000000000000000000000000000",
93
+ "hw_ver": "1.0",
94
+ "jamming_rssi": -120,
95
+ "jamming_signal_level": 1,
96
+ "lastOnboardingTimestamp": 1706789728,
97
+ "mac": "E4FAC4000000",
98
+ "model": "T310",
99
+ "nickname": "I01BU0tFRF9OQU1FIw==",
100
+ "oem_id": "00000000000000000000000000000000",
101
+ "parent_device_id": "0000000000000000000000000000000000000000",
102
+ "region": "Europe/London",
103
+ "report_interval": 16,
104
+ "rssi": -81,
105
+ "signal_level": 1,
106
+ "specs": "EU",
107
+ "status": "online",
108
+ "status_follow_edge": false,
109
+ "temp_unit": "celsius",
110
+ "type": "SMART.TAPOSENSOR"
111
+ },
112
+ "get_fw_download_state": {
113
+ "cloud_cache_seconds": 1,
114
+ "download_progress": 0,
115
+ "reboot_time": 5,
116
+ "status": 0,
117
+ "upgrade_time": 5
118
+ },
119
+ "get_latest_fw": {
120
+ "fw_size": 0,
121
+ "fw_ver": "1.5.0 Build 230105 Rel.150707",
122
+ "hw_id": "",
123
+ "need_to_upgrade": false,
124
+ "oem_id": "",
125
+ "release_date": "",
126
+ "release_note": "",
127
+ "type": 0
128
+ },
129
+ "get_temp_humidity_records": {
130
+ "local_time": 1713550233,
131
+ "past24h_humidity": [
132
+ 60,
133
+ 60,
134
+ 60,
135
+ 60,
136
+ 60,
137
+ 60,
138
+ 60,
139
+ 60,
140
+ 60,
141
+ 61,
142
+ 61,
143
+ 61,
144
+ 61,
145
+ 61,
146
+ 61,
147
+ 61,
148
+ 61,
149
+ 61,
150
+ 61,
151
+ 61,
152
+ 61,
153
+ 62,
154
+ 61,
155
+ 61,
156
+ 62,
157
+ 61,
158
+ 60,
159
+ 61,
160
+ 61,
161
+ 61,
162
+ 61,
163
+ 61,
164
+ 61,
165
+ 61,
166
+ 61,
167
+ 61,
168
+ 61,
169
+ 62,
170
+ 62,
171
+ 62,
172
+ 62,
173
+ 62,
174
+ 62,
175
+ 62,
176
+ 62,
177
+ 62,
178
+ 62,
179
+ 62,
180
+ 62,
181
+ 62,
182
+ 62,
183
+ 63,
184
+ 63,
185
+ 63,
186
+ 64,
187
+ 63,
188
+ 63,
189
+ 63,
190
+ 63,
191
+ 62,
192
+ 63,
193
+ 63,
194
+ 62,
195
+ 62,
196
+ 62,
197
+ 62,
198
+ 62,
199
+ 61,
200
+ 62,
201
+ 61,
202
+ 61,
203
+ 61,
204
+ 61,
205
+ 61,
206
+ 61,
207
+ 60,
208
+ 61,
209
+ 64,
210
+ 64,
211
+ 61,
212
+ 61,
213
+ 63,
214
+ 60,
215
+ 60,
216
+ 60,
217
+ 60,
218
+ 59,
219
+ 59,
220
+ 59,
221
+ 59,
222
+ 59,
223
+ 58,
224
+ 58,
225
+ 58,
226
+ 57,
227
+ 55
228
+ ],
229
+ "past24h_humidity_exception": [
230
+ 0,
231
+ 0,
232
+ 0,
233
+ 0,
234
+ 0,
235
+ 0,
236
+ 0,
237
+ 0,
238
+ 0,
239
+ 1,
240
+ 1,
241
+ 1,
242
+ 1,
243
+ 1,
244
+ 1,
245
+ 1,
246
+ 1,
247
+ 1,
248
+ 1,
249
+ 1,
250
+ 1,
251
+ 2,
252
+ 1,
253
+ 1,
254
+ 2,
255
+ 1,
256
+ 0,
257
+ 1,
258
+ 1,
259
+ 1,
260
+ 1,
261
+ 1,
262
+ 1,
263
+ 1,
264
+ 1,
265
+ 1,
266
+ 1,
267
+ 2,
268
+ 2,
269
+ 2,
270
+ 2,
271
+ 2,
272
+ 2,
273
+ 2,
274
+ 2,
275
+ 2,
276
+ 2,
277
+ 2,
278
+ 2,
279
+ 2,
280
+ 2,
281
+ 3,
282
+ 3,
283
+ 3,
284
+ 4,
285
+ 3,
286
+ 3,
287
+ 3,
288
+ 3,
289
+ 2,
290
+ 3,
291
+ 3,
292
+ 2,
293
+ 2,
294
+ 2,
295
+ 2,
296
+ 2,
297
+ 1,
298
+ 2,
299
+ 1,
300
+ 1,
301
+ 1,
302
+ 1,
303
+ 1,
304
+ 1,
305
+ 0,
306
+ 1,
307
+ 4,
308
+ 4,
309
+ 1,
310
+ 1,
311
+ 3,
312
+ 0,
313
+ 0,
314
+ 0,
315
+ 0,
316
+ 0,
317
+ 0,
318
+ 0,
319
+ 0,
320
+ 0,
321
+ 0,
322
+ 0,
323
+ 0,
324
+ 0,
325
+ 0
326
+ ],
327
+ "past24h_temp": [
328
+ 175,
329
+ 175,
330
+ 174,
331
+ 174,
332
+ 173,
333
+ 172,
334
+ 172,
335
+ 171,
336
+ 170,
337
+ 169,
338
+ 169,
339
+ 167,
340
+ 167,
341
+ 166,
342
+ 165,
343
+ 164,
344
+ 163,
345
+ 163,
346
+ 162,
347
+ 162,
348
+ 162,
349
+ 162,
350
+ 163,
351
+ 163,
352
+ 162,
353
+ 162,
354
+ 161,
355
+ 160,
356
+ 159,
357
+ 159,
358
+ 159,
359
+ 159,
360
+ 158,
361
+ 158,
362
+ 159,
363
+ 159,
364
+ 158,
365
+ 159,
366
+ 159,
367
+ 159,
368
+ 159,
369
+ 159,
370
+ 159,
371
+ 159,
372
+ 159,
373
+ 159,
374
+ 158,
375
+ 158,
376
+ 158,
377
+ 158,
378
+ 158,
379
+ 158,
380
+ 159,
381
+ 159,
382
+ 160,
383
+ 161,
384
+ 161,
385
+ 162,
386
+ 162,
387
+ 162,
388
+ 162,
389
+ 162,
390
+ 163,
391
+ 163,
392
+ 166,
393
+ 168,
394
+ 170,
395
+ 172,
396
+ 174,
397
+ 175,
398
+ 176,
399
+ 177,
400
+ 179,
401
+ 181,
402
+ 183,
403
+ 184,
404
+ 185,
405
+ 187,
406
+ 189,
407
+ 190,
408
+ 190,
409
+ 193,
410
+ 194,
411
+ 194,
412
+ 194,
413
+ 194,
414
+ 194,
415
+ 194,
416
+ 195,
417
+ 195,
418
+ 195,
419
+ 196,
420
+ 196,
421
+ 196,
422
+ 195,
423
+ 193
424
+ ],
425
+ "past24h_temp_exception": [
426
+ 0,
427
+ 0,
428
+ 0,
429
+ 0,
430
+ 0,
431
+ 0,
432
+ 0,
433
+ 0,
434
+ 0,
435
+ 0,
436
+ 0,
437
+ 0,
438
+ 0,
439
+ 0,
440
+ 0,
441
+ 0,
442
+ 0,
443
+ 0,
444
+ 0,
445
+ 0,
446
+ 0,
447
+ 0,
448
+ 0,
449
+ 0,
450
+ 0,
451
+ 0,
452
+ 0,
453
+ 0,
454
+ -1,
455
+ -1,
456
+ -1,
457
+ -1,
458
+ -2,
459
+ -2,
460
+ -1,
461
+ -1,
462
+ -2,
463
+ -1,
464
+ -1,
465
+ -1,
466
+ -1,
467
+ -1,
468
+ -1,
469
+ -1,
470
+ -1,
471
+ -1,
472
+ -2,
473
+ -2,
474
+ -2,
475
+ -2,
476
+ -2,
477
+ -2,
478
+ -1,
479
+ -1,
480
+ 0,
481
+ 0,
482
+ 0,
483
+ 0,
484
+ 0,
485
+ 0,
486
+ 0,
487
+ 0,
488
+ 0,
489
+ 0,
490
+ 0,
491
+ 0,
492
+ 0,
493
+ 0,
494
+ 0,
495
+ 0,
496
+ 0,
497
+ 0,
498
+ 0,
499
+ 0,
500
+ 0,
501
+ 0,
502
+ 0,
503
+ 0,
504
+ 0,
505
+ 0,
506
+ 0,
507
+ 0,
508
+ 0,
509
+ 0,
510
+ 0,
511
+ 0,
512
+ 0,
513
+ 0,
514
+ 0,
515
+ 0,
516
+ 0,
517
+ 0,
518
+ 0,
519
+ 0,
520
+ 0,
521
+ 0
522
+ ],
523
+ "temp_unit": "celsius"
524
+ },
525
+ "get_trigger_logs": {
526
+ "logs": [],
527
+ "start_id": 0,
528
+ "sum": 0
529
+ }
530
+ }