diff --git a/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json b/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json new file mode 100644 index 00000000..b57a01d2 --- /dev/null +++ b/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json @@ -0,0 +1,85 @@ +{ + "smartlife.iot.common.emeter": { + "get_realtime": { + "err_code": 0, + "power_mw": 1300 + } + }, + "smartlife.iot.smartbulb.lightingservice": { + "get_light_state": { + "brightness": 5, + "color_temp": 2700, + "err_code": 0, + "hue": 1, + "mode": "normal", + "on_off": 1, + "saturation": 1 + } + }, + "system": { + "get_sysinfo": { + "active_mode": "schedule", + "alias": "bedroom", + "ctrl_protocols": { + "name": "Linkie", + "version": "1.0" + }, + "description": "Smart Wi-Fi LED Bulb with Color Changing", + "dev_state": "normal", + "deviceId": "0000000000000000000000000000000000000000", + "disco_ver": "1.0", + "err_code": 0, + "heapsize": 332316, + "hwId": "00000000000000000000000000000000", + "hw_ver": "1.0", + "is_color": 1, + "is_dimmable": 1, + "is_factory": false, + "is_variable_color_temp": 1, + "light_state": { + "brightness": 5, + "color_temp": 2700, + "hue": 1, + "mode": "normal", + "on_off": 1, + "saturation": 1 + }, + "mic_mac": "000000000000", + "mic_type": "IOT.SMARTBULB", + "model": "KL130(EU)", + "oemId": "00000000000000000000000000000000", + "preferred_state": [ + { + "brightness": 10, + "color_temp": 2500, + "hue": 0, + "index": 0, + "saturation": 0 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 299, + "index": 1, + "saturation": 95 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 120, + "index": 2, + "saturation": 75 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 240, + "index": 3, + "saturation": 75 + } + ], + "rssi": -62, + "sw_ver": "1.8.8 Build 190613 Rel.123436" + } + } +} diff --git a/kasa/tests/test_lightstrip.py b/kasa/tests/test_lightstrip.py new file mode 100644 index 00000000..7a8d8726 --- /dev/null +++ b/kasa/tests/test_lightstrip.py @@ -0,0 +1,17 @@ +from kasa import DeviceType, SmartLightStrip + +from .conftest import lightstrip, pytestmark + + +@lightstrip +async def test_lightstrip_length(dev: SmartLightStrip): + assert dev.is_light_strip + assert dev.device_type == DeviceType.LightStrip + assert dev.length == dev.sys_info["length"] + + +@lightstrip +async def test_lightstrip_effect(dev: SmartLightStrip): + assert isinstance(dev.effect, dict) + for k in ["brightness", "custom", "enable", "id", "name"]: + assert k in dev.effect