mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-09-19 20:43:52 +00:00
Add KL420 to TPLINK_KELVIN color temperature ranges (#1757)
Adds the `KL420` series to `TPLINK_KELVIN` to support wider color temperature ranges (2500-9000K as supported by the device). While older firmware (1.0.2) reported is_variable_color_temp: 0, firmware 1.0.7 enables variable color temperature support.
This commit is contained in:
@@ -55,9 +55,13 @@ 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"}
|
||||
# KL400L5 firmware 1.0.5/1.0.8 and KL420L5 firmware 1.0.2 fixtures report no
|
||||
# variable color temperature support, so match the supporting fixtures rather
|
||||
# than the entire model.
|
||||
BULBS_IOT_VARIABLE_TEMP_FIXTURES = {
|
||||
"KL400L5(US)_1.0_1.0.11",
|
||||
"KL420L5(US)_1.0_1.0.7",
|
||||
}
|
||||
BULBS_IOT_COLOR = {"LB130", "KL125", "KL130", "KL135", *BULBS_IOT_LIGHT_STRIP}
|
||||
BULBS_IOT_DIMMABLE = {"KL50", "KL60", "LB100", "LB110", "KL110", "KL110B"}
|
||||
BULBS_IOT = (
|
||||
|
||||
@@ -129,14 +129,9 @@ def filter_fixtures(
|
||||
if isinstance(model_filter, str):
|
||||
model_filter = {model_filter}
|
||||
assert isinstance(model_filter, set), "model filter must be a set"
|
||||
model_filter_list = [mf for mf in model_filter]
|
||||
if (
|
||||
len(model_filter_list) == 1
|
||||
and (model := model_filter_list[0])
|
||||
and len(model.split("_")) == 3
|
||||
):
|
||||
# filter string includes hw and fw, return exact match
|
||||
return fixture_data.name == f"{model}.json"
|
||||
fixture_base = fixture_data.name.removesuffix(".json")
|
||||
if fixture_base in model_filter or fixture_data.name in model_filter:
|
||||
return True
|
||||
file_model_region = fixture_data.name.split("_")[0]
|
||||
file_model = file_model_region.split("(")[0]
|
||||
return file_model in model_filter
|
||||
|
||||
57
tests/fixtures/iot/KL420L5(US)_1.0_1.0.7.json
vendored
Normal file
57
tests/fixtures/iot/KL420L5(US)_1.0_1.0.7.json
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"smartlife.iot.common.emeter": {
|
||||
"get_realtime": {
|
||||
"err_code": 0,
|
||||
"power_mw": 500,
|
||||
"total_wh": 1192
|
||||
}
|
||||
},
|
||||
"system": {
|
||||
"get_sysinfo": {
|
||||
"LEF": 1,
|
||||
"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": 50,
|
||||
"light_state": {
|
||||
"brightness": 60,
|
||||
"color_temp": 2700,
|
||||
"hue": 0,
|
||||
"mode": "normal",
|
||||
"on_off": 1,
|
||||
"saturation": 0
|
||||
},
|
||||
"lighting_effect_state": {
|
||||
"brightness": 60,
|
||||
"custom": 0,
|
||||
"enable": 0,
|
||||
"id": "CdLeIgiKcQrLKMINRPTMbylATulQewLD",
|
||||
"name": "Aurora"
|
||||
},
|
||||
"longitude_i": 0,
|
||||
"mic_mac": "00:00:00:00:00:00",
|
||||
"mic_type": "IOT.SMARTBULB",
|
||||
"model": "KL420L5(US)",
|
||||
"oemId": "00000000000000000000000000000000",
|
||||
"preferred_state": [],
|
||||
"rssi": -19,
|
||||
"status": "new",
|
||||
"sw_ver": "1.0.7 Build 240809 Rel.170227"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user