10000 Add KL130 fixture, initial lightstrip tests (#214) · python-kasa/python-kasa@f1b28e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1b28e7

Browse files
authored
Add KL130 fixture, initial lightstrip tests (#214)
1 parent acb221b commit f1b28e7

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"smartlife.iot.common.emeter": {
3+
"get_realtime": {
4+
"err_code": 0,
5+
"power_mw": 1300
6+
}
7+
},
8+
"smartlife.iot.smartbulb.lightingservice": {
9+
"get_light_state": {
10+
"brightness": 5,
11+
"color_temp": 2700,
12+
"err_code": 0,
13+
"hue": 1,
14+
"mode": "normal",
15+
"on_off": 1,
16+
"saturation": 1
17+
}
18+
},
19+
"system": {
20+
"get_sysinfo": {
21+
"active_mode": "schedule",
22+
"alias": "bedroom",
23+
"ctrl_protocols": {
24+
"name": "Linkie",
25+
"version": "1.0"
26+
},
27+
"description": "Smart Wi-Fi LED Bulb with Color Changing",
28+
"dev_state": "normal",
29+
"deviceId": "0000000000000000000000000000000000000000",
30+
"disco_ver": "1.0",
31+
"err_code": 0,
32+
"heapsize": 332316,
33+
"hwId": "00000000000000000000000000000000",
34+
"hw_ver": "1.0",
35+
"is_color": 1,
36+
"is_dimmable": 1,
37+
"is_factory": false,
38+
"is_variable_color_temp": 1,
39+
"light_state": {
40+
"brightness": 5,
41+
"color_temp": 2700,
42+
"hue": 1,
43+
"mode": "normal",
44+
"on_off": 1,
45+
"saturation": 1
46+
},
47+
"mic_mac": "000000000000"< 10000 /span>,
48+
"mic_type": "IOT.SMARTBULB",
49+
"model": "KL130(EU)",
50+
"oemId": "00000000000000000000000000000000",
51+
"preferred_state": [
52+
{
53+
"brightness": 10,
54+
"color_temp": 2500,
55+
"hue": 0,
56+
"index": 0,
57+
"saturation": 0
58+
},
59+
{
60+
"brightness": 100,
61+
"color_temp": 0,
62+
"hue": 299,
63+
"index": 1,
64+
"saturation": 95
65+
},
66+
{
67+
"brightness": 100,
68+
"color_temp": 0,
69+
"hue": 120,
70+
"index": 2,
71+
"saturation": 75
72+
},
73+
{
74+
"brightness": 100,
75+
"color_temp": 0,
76+
"hue": 240,
77+
"index": 3,
78+
"saturation": 75
79+
}
80+
],
81+
"rssi": -62,
82+
"sw_ver": "1.8.8 Build 190613 Rel.123436"
83+
}
84+
}
85+
}

kasa/tests/test_lightstrip.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from kasa import DeviceType, SmartLightStrip
2+
3+
from .conftest import lightstrip, pytestmark
4+
5+
6+
@lightstrip
7+
async def test_lightstrip_length(dev: SmartLightStrip):
8+
assert dev.is_light_strip
9+
assert dev.device_type == DeviceType.LightStrip
10+
assert dev.length == dev.sys_info["length"]
11+
12+
13+
@lightstrip
14+
async def test_lightstrip_effect(dev: SmartLightStrip):
15+
assert isinstance(dev.effect, dict)
16+
for k in ["brightness", "custom", "enable", "id", "name"]:
17+
assert k in dev.effect

0 commit comments

Comments
 (0)
0