8000 Add real kasa KL430(UN) device dump (#192) · python-kasa/python-kasa@7c9d21a · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 7c9d21a

Browse files
Add real kasa KL430(UN) device dump (#192)
* Add real kasa KL430(UN) device dump * Adjust hue&sat max values * light strips, as bulbs, have only power for emeter Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
1 parent 4e8a318 commit 7c9d21a

File tree

3 files changed

+93
-3
lines changed

3 files changed

+93
-3
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"smartlife.iot.common.emeter": {
3+
"get_realtime": {
4+
"err_code": 0,
5+
"power_mw": 16760,
6+
"total_wh": 120
7+
}
8+
},
9+
"system": {
10+
"get_sysinfo": {
11+
"LEF": 1,
12+
"active_mode": "none",
13+
"alias": "Bedroom light strip",
14+
"ctrl_protocols": {
15+
"name": "Linkie",
16+
"version": "1.0"
17+
},
18+
"description": "Kasa Smart Light Strip, Multicolor",
19+
"dev_state": "normal",
20+
"deviceId": "0000000000000000000000000000000000000000",
21+
"disco_ver": "1.0",
22+
"err_code": 0,
23+
"hwId": "00000000000000000000000000000000",
24+
"hw_ver": "2.0",
25+
"is_color": 1,
26+
"is_dimmable": 1,
27+
"is_factory": false,
28+
"is_variable_color_temp": 1,
29+
"latitude_i": 0,
30+
"length": 16,
31+
"light_state": {
32+
"brightness": 100,
33+
"color_temp": 9000,
34+
"hue": 0,
35+
"mode": "normal",
36+
"on_off": 1,
37+
"saturation": 0
38+
},
39+
"lighting_effect_state": {
40+
"brightness": 100,
41+
"custom": 1,
42+
"enable": 1,
43+
"id": "yMwcNpLxijmoKamskHCvvravpbnIqAIN",
44+
"name": "Aurora 1"
45+
},
46+
"longitude_i": 0,
47+
"mic_mac": "00:00:00:00:00:00",
48+
"mic_type": "IOT.SMARTBULB",
49+
"model": "KL430(UN)",
50+
"oemId": "00000000000000000000000000000000",
51+
"preferred_state": [
52+
{
53+
"brightness": 100,
54+
"color_temp": 9000,
55+
"hue": 0,
56+
"index": 0,
57+
"mode": 1,
58+
"saturation": 0
59+
},
60+
{
61+
"brightness": 100,
62+
"color_temp": 0,
63+
"hue": 217,
64+
"index": 1,
65+
"mode": 1,
66+
"saturation": 99
67+
},
68+
{
69+
"brightness": 100,
70+
"color_temp": 0,
71+
"hue": 194,
72+
"index": 2,
73+
"mode": 1,
74+
"saturation": 50
75+
},
76+
{
77+
"brightness": 100,
78+
"color_temp": 0,
79+
"hue": 277,
80+
"index": 3,
81+
"mode": 1,
82+
"saturation": 86
83+
}
84+
],
85+
"rssi": -43,
86+
"status": "new",
87+
"sw_ver": "1.0.8 Build 210121 Rel.084339"
88+
}
89+
}
90+
}

kasa/tests/newfakes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def lb_dev_state(x):
150150
{
151151
"brightness": All(int, Range(min=0, max=100)),
152152
"color_temp": int,
153-
"hue": All(int, Range(min=0, max=255)),
153+
"hue": All(int, Range(min=0, max=360)),
154154
"index": int,
155-
"saturation": All(int, Range(min=0, max=255)),
155+
"saturation": All(int, Range(min=0, max=100)),
156156
}
157157
],
158158
}

kasa/tests/test_emeter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def test_emeter_status(dev):
8989

9090
assert d["power_mw"] == d["power"] * 1000
9191
# bulbs have only power according to tplink simulator.
92-
if not dev.is_bulb:
92+
if not dev.is_bulb and not dev.is_light_strip:
9393
assert d["voltage_mv"] == d["voltage"] * 1000
9494

9595
assert d["current_ma"] == d["current"] * 1000

0 commit comments

Comments
 (0)
0