diff --git a/SUPPORTED.md b/SUPPORTED.md index a3d9c336..3e4eb5d5 100644 --- a/SUPPORTED.md +++ b/SUPPORTED.md @@ -164,6 +164,7 @@ Some newer Kasa devices require authentication. These are marked with [^1] in th - **KL400L10** - Hardware: 1.0 (US) / Firmware: 1.0.10 - **KL400L5** + - Hardware: 1.0 (US) / Firmware: 1.0.11 - Hardware: 1.0 (US) / Firmware: 1.0.5 - Hardware: 1.0 (US) / Firmware: 1.0.8 - **KL420L5** diff --git a/kasa/iot/iotbulb.py b/kasa/iot/iotbulb.py index 42e993ba..33c7a2be 100644 --- a/kasa/iot/iotbulb.py +++ b/kasa/iot/iotbulb.py @@ -90,6 +90,7 @@ TPLINK_KELVIN = { "KL135": ColorTempRange(2500, 9000), r"KL120\(EU\)": ColorTempRange(2700, 6500), r"KL120\(US\)": ColorTempRange(2700, 5000), + r"KL400L5": ColorTempRange(2500, 9000), r"KL430": ColorTempRange(2500, 9000), } diff --git a/tests/device_fixtures.py b/tests/device_fixtures.py index d928f542..0edce51e 100644 --- a/tests/device_fixtures.py +++ b/tests/device_fixtures.py @@ -55,6 +55,9 @@ BULBS_IOT_VARIABLE_TEMP = { "KL135", "KL430", } +# KL400L5 firmware 1.0.5 and 1.0.8 fixtures report no variable color temperature +# support, so match the supporting 1.0.11 fixture rather than the entire model. +BULBS_IOT_VARIABLE_TEMP_FIXTURES = {"KL400L5(US)_1.0_1.0.11"} BULBS_IOT_COLOR = {"LB130", "KL125", "KL130", "KL135", *BULBS_IOT_LIGHT_STRIP} BULBS_IOT_DIMMABLE = {"KL50", "KL60", "LB100", "LB110", "KL110", "KL110B"} BULBS_IOT = ( @@ -274,16 +277,23 @@ dimmable_iot = parametrize("dimmable", model_filter=DIMMABLE, protocol_filter={" non_dimmable_iot = parametrize( "non-dimmable", model_filter=BULBS - DIMMABLE, protocol_filter={"IOT"} ) -variable_temp = parametrize( +variable_temp_by_model = parametrize( "variable color temp", model_filter=BULBS_VARIABLE_TEMP, protocol_filter={"SMART", "IOT"}, ) +variable_temp_by_fixture = parametrize( + "variable color temp fixtures", + model_filter=BULBS_IOT_VARIABLE_TEMP_FIXTURES, + protocol_filter={"IOT"}, +) +variable_temp = parametrize_combine([variable_temp_by_model, variable_temp_by_fixture]) non_variable_temp = parametrize( "non-variable color temp", model_filter=BULBS - BULBS_VARIABLE_TEMP, protocol_filter={"SMART", "IOT"}, ) +non_variable_temp = parametrize_subtract(non_variable_temp, variable_temp_by_fixture) color_bulb = parametrize( "color bulbs", model_filter=BULBS_COLOR, protocol_filter={"SMART", "IOT"} ) @@ -296,11 +306,14 @@ non_color_bulb = parametrize( color_bulb_iot = parametrize( "color bulbs iot", model_filter=BULBS_IOT_COLOR, protocol_filter={"IOT"} ) -variable_temp_iot = parametrize( +variable_temp_iot_by_model = parametrize( "variable color temp iot", model_filter=BULBS_IOT_VARIABLE_TEMP, protocol_filter={"IOT"}, ) +variable_temp_iot = parametrize_combine( + [variable_temp_iot_by_model, variable_temp_by_fixture] +) variable_temp_smart = parametrize( "variable color temp smart", model_filter=BULBS_SMART_VARIABLE_TEMP, diff --git a/tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json b/tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json new file mode 100644 index 00000000..f00951ff --- /dev/null +++ b/tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json @@ -0,0 +1,98 @@ +{ + "smartlife.iot.common.emeter": { + "get_realtime": { + "err_code": 0, + "power_mw": 9600, + "total_wh": 1193 + } + }, + "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": 1, + "latitude_i": 0, + "length": 1, + "light_state": { + "brightness": 70, + "color_temp": 3015, + "hue": 0, + "mode": "normal", + "on_off": 1, + "saturation": 0 + }, + "lighting_effect_state": { + "brightness": 43, + "custom": 0, + "enable": 0, + "id": "CdLeIgiKcQrLKMINRPTMbylATulQewLD", + "name": "Aurora" + }, + "longitude_i": 0, + "mic_mac": "00:00:00:00:00:00", + "mic_type": "IOT.SMARTBULB", + "model": "KL400L5(US)", + "oemId": "00000000000000000000000000000000", + "preferred_state": [ + { + "brightness": 50, + "color_temp": 9500, + "hue": 0, + "index": 0, + "mode": 1, + "saturation": 0 + }, + { + "brightness": 50, + "color_temp": 0, + "hue": 240, + "index": 1, + "mode": 1, + "saturation": 100 + }, + { + "brightness": 50, + "color_temp": 0, + "hue": 0, + "index": 2, + "mode": 1, + "saturation": 100 + }, + { + "brightness": 100, + "color_temp": 3015, + "hue": 0, + "index": 3, + "mode": 1, + "saturation": 0 + }, + { + "brightness": 50, + "color_temp": 0, + "hue": 277, + "index": 4, + "mode": 1, + "saturation": 86 + } + ], + "rssi": -56, + "status": "new", + "sw_ver": "1.0.11 Build 240809 Rel.173811" + } + } +}