8000 dump_devinfo: iot light strip commands (#1286) · ryenitcher/python-kasa@0e5013d · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e5013d

Browse files
authored
dump_devinfo: iot light strip commands (python-kasa#1286)
1 parent 5eca487 commit 0e5013d

File tree

3 files changed

+95
-7
lines changed

3 files changed

+95
-7
lines changed

devtools/dump_devinfo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ async def get_legacy_fixture(
420420
Call(
421421
module="smartlife.iot.smartbulb.lightingservice", method="get_light_details"
422422
),
423+
Call(module="smartlife.iot.lightStrip", method="get_default_behavior"),
424+
Call(module="smartlife.iot.lightStrip", method="get_light_state"),
425+
Call(module="smartlife.iot.lightStrip", method="get_light_details"),
423426
Call(module="smartlife.iot.LAS", method="get_config"),
424427
Call(module="smartlife.iot.LAS", method="get_current_brt"),
425428
Call(module="smartlife.iot.PIR", method="get_config"),

tests/fixtures/KL430(US)_2.0_1.0.11.json

Lines changed: 89 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,93 @@
11
{
2+
"smartlife.iot.common.cloud": {
3+
"get_info": {
4+
"binded": 1,
5+
"cld_connection": 1,
6+
"err_code": 0,
7+
"fwDlPage": "",
8+
"fwNotifyType": -1,
9+
"illegalType": 0,
10+
"server": "n-devs.tplinkcloud.com",
11+
"stopConnect": 0,
12+
"tcspInfo": "",
13+
"tcspStatus": 1,
14+
"username": "#MASKED_NAME#"
15+
},
16+
"get_intl_fw_list": {
17+
"err_code": 0,
18+
"fw_list": [
19+
{
20+
"fwLocation": 0,
21+
"fwReleaseDate": "2024-06-28",
22+
"fwReleaseLog": "Modifications and Bug Fixes:\n1. Enhanced device stability.\n2. Fixed the problem that Color Painting doesn't work properly in some cases.\n3. Fixed some minor bugs.",
23+
"fwReleaseLogUrl": "undefined yet",
24+
"fwTitle": "Hi, a new firmware with bug fixes is available for your product.",
25+
"fwType": 1,
26+
"fwUrl": "http://download.tplinkcloud.com/firmware/KLM430v2_FCC_KL430_1.0.12_Build_240227_Rel.160022_2024-02-27_16.01.59_1719559326313.bin",
27+
"fwVer": "1.0.12 Build 240227 Rel.160022"
28+
}
29+
]
30+
}
31+
},
232
"smartlife.iot.common.emeter": {
333
"get_realtime": {
434
"err_code": 0,
535
"power_mw": 600,
636
"total_wh": 0
737
}
838
},
39+
"smartlife.iot.common.schedule": {
40+
"get_next_action": {
41+
"err_code": 0,
42+
"type": -1
43+
},
44+
"get_rules": {
45+
"enable": 0,
46+
"err_code": 0,
47+
"rule_list": [],
48+
"version": 2
49+
}
50+
},
51+
"smartlife.iot.lightStrip": {
52+
"get_default_behavior": {
53+
"err_code": 0,
54+
"hard_on": {
55+
"mode": "last_status"
56+
},
57+
"soft_on": {
58+
"mode": "last_status"
59+
}
60+
},
61+
"get_light_details": {
62+
"color_rendering_index": 80,
63+
"err_code": 0,
64+
"incandescent_equivalent": 60,
65+
"lamp_beam_angle": 180,
66+
"max_lumens": 800,
67+
"max_voltage": 120,
68+
"min_voltage": 100,
69+
"wattage": 10
70+
},
71+
"get_light_state": {
72+
"dft_on_state": {
73+
"groups": [
74+
[
75+
0,
76+
15,
77+
0,
78+
0,
79+
100,
80+
3842
81+
]
82+
],
83+
"mode": "normal"
84+
},
85+
"err_code": 0,
86+
"length": 16,
87+
"on_off": 0,
88+
"transition": 500
89+
}
90+
},
991
"system": {
1092
"get_sysinfo": {
1193
"LEF": 1,
@@ -31,27 +113,27 @@
31113
"light_state": {
32114
"dft_on_state": {
33115
"brightness": 100,
34-
"color_temp": 9000,
35-
"hue": 9,
116+
"color_temp": 3842,
117+
"hue": 0,
36118
"mode": "normal",
37-
"saturation": 67
119+
"saturation": 0
38120
},
39121
"on_off": 0
40122
},
41123
"lighting_effect_state": {
42-
"brightness": 70,
124+
"brightness": 100,
43125
"custom": 0,
44126
"enable": 0,
45-
"id": "joqVjlaTsgzmuQQBAlHRkkPAqkBUiqeb",
46-
"name": "Icicle"
127+
"id": "bCTItKETDFfrKANolgldxfgOakaarARs",
128+
"name": "Flicker"
47129
},
48130
"longitude_i": 0,
49131
"mic_mac": "E8:48:B8:00:00:00",
50132
"mic_type": "IOT.SMARTBULB",
51133
"model": "KL430(US)",
52134
"oemId": "00000000000000000000000000000000",
53135
"preferred_state": [],
54-
"rssi": -43,
136+
"rssi": -35,
55137
"status": "new",
56138
"sw_ver": "1.0.11 Build 220812 Rel.153345"
57139
}

tests/test_bulb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,16 @@ async def test_modify_preset_payloads(dev: IotBulb, preset, payload, mocker):
453453
"mode": str,
454454
"on_off": Boolean,
455455
"saturation": All(int, Range(min=0, max=100)),
456+
"length": Optional(int),
457+
"transition": Optional(int),
456458
"dft_on_state": Optional(
457459
{
458460
"brightness": All(int, Range(min=0, max=100)),
459461
"color_temp": All(int, Range(min=0, max=9000)),
460462
"hue": All(int, Range(min=0, max=360)),
461463
"mode": str,
462464
"saturation": All(int, Range(min=0, max=100)),
465+
"groups": Optional(list[int]),
463466
}
464467
),
465468
"err_code": int,

0 commit comments

Comments
 (0)
0