From e21ab90e96d696d924bdbfec1ec4d8cf9f7c8ee0 Mon Sep 17 00:00:00 2001 From: mjbohr Date: Sun, 1 Jun 2025 14:26:34 -0400 Subject: [PATCH] Adding KL400L10(US)_1.0_1.0.10 fixture (#1539) Adding KL400L10(US)_1.0_1.0.10 fixture --------- Co-authored-by: Teemu Rytilahti --- README.md | 2 +- SUPPORTED.md | 2 + tests/device_fixtures.py | 2 +- .../fixtures/iot/KL400L10(US)_1.0_1.0.10.json | 144 ++++++++++++++++++ tests/iot/test_iotbulb.py | 1 + 5 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/iot/KL400L10(US)_1.0_1.0.10.json diff --git a/README.md b/README.md index c9247b40..c422c14d 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ The following devices have been tested and confirmed as working. If your device - **Power Strips**: EP40, EP40M[^1], HS107, HS300, KP200, KP303, KP400 - **Wall Switches**: ES20M, HS200[^2], HS210, HS220[^2], KP405, KS200, KS200M, KS205[^1], KS220, KS220M, KS225[^1], KS230, KS240[^1] - **Bulbs**: KL110, KL120, KL125, KL130, KL135, KL50, KL60, LB100, LB110 -- **Light Strips**: KL400L5, KL420L5, KL430 +- **Light Strips**: KL400L10, KL400L5, KL420L5, KL430 - **Hubs**: KH100[^1] - **Hub-Connected Devices[^3]**: KE100[^1] diff --git a/SUPPORTED.md b/SUPPORTED.md index 00de4d75..200689b6 100644 --- a/SUPPORTED.md +++ b/SUPPORTED.md @@ -156,6 +156,8 @@ Some newer Kasa devices require authentication. These are marked with [^1] in th ### Light Strips +- **KL400L10** + - Hardware: 1.0 (US) / Firmware: 1.0.10 - **KL400L5** - Hardware: 1.0 (US) / Firmware: 1.0.5 - Hardware: 1.0 (US) / Firmware: 1.0.8 diff --git a/tests/device_fixtures.py b/tests/device_fixtures.py index 4cae98f1..4d6a2d80 100644 --- a/tests/device_fixtures.py +++ b/tests/device_fixtures.py @@ -38,7 +38,7 @@ BULBS_SMART = ( ) # Kasa (IOT-prefixed) bulbs -BULBS_IOT_LIGHT_STRIP = {"KL400L5", "KL430", "KL420L5"} +BULBS_IOT_LIGHT_STRIP = {"KL400L5", "KL400L10", "KL430", "KL420L5"} BULBS_IOT_VARIABLE_TEMP = { "LB120", "LB130", diff --git a/tests/fixtures/iot/KL400L10(US)_1.0_1.0.10.json b/tests/fixtures/iot/KL400L10(US)_1.0_1.0.10.json new file mode 100644 index 00000000..db449655 --- /dev/null +++ b/tests/fixtures/iot/KL400L10(US)_1.0_1.0.10.json @@ -0,0 +1,144 @@ +{ + "smartlife.iot.common.cloud": { + "get_info": { + "binded": 1, + "cld_connection": 1, + "err_code": 0, + "fwDlPage": "", + "fwNotifyType": -1, + "illegalType": 0, + "server": "n-devs.tplinkcloud.com", + "stopConnect": 0, + "tcspInfo": "", + "tcspStatus": 1, + "username": "user@example.com" + }, + "get_intl_fw_list": { + "err_code": 0, + "fw_list": [] + } + }, + "smartlife.iot.common.emeter": { + "get_realtime": { + "err_code": 0, + "power_mw": 1800, + "total_wh": 443 + } + }, + "smartlife.iot.common.schedule": { + "get_next_action": { + "err_code": 0, + "type": -1 + }, + "get_rules": { + "enable": 0, + "err_code": 0, + "rule_list": [], + "version": 2 + } + }, + "smartlife.iot.lightStrip": { + "get_default_behavior": { + "err_code": 0, + "hard_on": { + "mode": "last_status" + }, + "soft_on": { + "mode": "last_status" + } + }, + "get_light_details": { + "color_rendering_index": 90, + "err_code": 0, + "incandescent_equivalent": 60, + "lamp_beam_angle": 220, + "max_lumens": 800, + "max_voltage": 120, + "min_voltage": 100, + "wattage": 10 + }, + "get_light_state": { + "err_code": 0, + "groups": [ + [ + 0, + 0, + 251, + 0, + 10, + 0 + ] + ], + "length": 1, + "mode": "normal", + "on_off": 1, + "transition": 500 + } + }, + "system": { + "get_sysinfo": { + "LEF": 0, + "active_mode": "none", + "alias": "#MASKED_NAME#", + "ctrl_protocols": { + "name": "Linkie", + "version": "1.0" + }, + "description": "Kasa Smart Light Strip, Multicolor", + "dev_state": "normal", + "deviceId": "0000000000000000000000000000000000000000", + "disco_ver": "1.0", + "err_code": 0, + "hwId": "00000000000000000000000000000000", + "hw_ver": "1.0", + "is_color": 1, + "is_dimmable": 1, + "is_factory": false, + "is_variable_color_temp": 0, + "latitude_i": 0, + "length": 1, + "light_state": { + "brightness": 10, + "color_temp": 0, + "hue": 251, + "mode": "normal", + "on_off": 1, + "saturation": 0 + }, + "lighting_effect_state": { + "brightness": 10, + "custom": 0, + "enable": 0, + "id": "ojqpUUxdGHoIugGPknrUcRoyJiItsjuE", + "name": "Lightning" + }, + "longitude_i": 0, + "mic_mac": "D8:44:89:00:00:00", + "mic_type": "IOT.SMARTBULB", + "model": "KL400L10(US)", + "obd_src": "tplink", + "oemId": "00000000000000000000000000000000", + "preferred_state": [ + { + "brightness": 100, + "color_temp": 0, + "hue": 1, + "index": 0, + "mode": 1, + "saturation": 100 + }, + { + "brightness": 15, + "color_temp": 0, + "hue": 251, + "index": 1, + "mode": 1, + "saturation": 0 + } + ], + "rssi": -38, + "status": "new", + "sw_ver": "1.0.10 Build 220929 Rel.170054" + } + } +} diff --git a/tests/iot/test_iotbulb.py b/tests/iot/test_iotbulb.py index 5b759c58..4d40dff6 100644 --- a/tests/iot/test_iotbulb.py +++ b/tests/iot/test_iotbulb.py @@ -277,6 +277,7 @@ LIGHT_STATE_SCHEMA = Schema( "saturation": All(int, Range(min=0, max=100)), "length": Optional(int), "transition": Optional(int), + "groups": Optional(list[int]), "dft_on_state": Optional( { "brightness": All(int, Range(min=0, max=100)),