mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-07-21 14:52:05 +00:00
Add KL400L5 color temperature range (#1719)
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
- add the KL400L5 color temperature range used by newer firmware - add a KL400L5(US) 1.0.11 fixture that reports variable color temperature support - categorize that fixture as variable color temperature while keeping older KL400L5 fixtures non-variable - The Tapo app exposes 2500K-9000K for these KL400L5 strips, so this PR uses that app-visible range. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -164,6 +164,7 @@ Some newer Kasa devices require authentication. These are marked with [^1] in th
|
|||||||
- **KL400L10**
|
- **KL400L10**
|
||||||
- Hardware: 1.0 (US) / Firmware: 1.0.10
|
- Hardware: 1.0 (US) / Firmware: 1.0.10
|
||||||
- **KL400L5**
|
- **KL400L5**
|
||||||
|
- Hardware: 1.0 (US) / Firmware: 1.0.11
|
||||||
- Hardware: 1.0 (US) / Firmware: 1.0.5
|
- Hardware: 1.0 (US) / Firmware: 1.0.5
|
||||||
- Hardware: 1.0 (US) / Firmware: 1.0.8
|
- Hardware: 1.0 (US) / Firmware: 1.0.8
|
||||||
- **KL420L5**
|
- **KL420L5**
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ TPLINK_KELVIN = {
|
|||||||
"KL135": ColorTempRange(2500, 9000),
|
"KL135": ColorTempRange(2500, 9000),
|
||||||
r"KL120\(EU\)": ColorTempRange(2700, 6500),
|
r"KL120\(EU\)": ColorTempRange(2700, 6500),
|
||||||
r"KL120\(US\)": ColorTempRange(2700, 5000),
|
r"KL120\(US\)": ColorTempRange(2700, 5000),
|
||||||
|
r"KL400L5": ColorTempRange(2500, 9000),
|
||||||
r"KL430": ColorTempRange(2500, 9000),
|
r"KL430": ColorTempRange(2500, 9000),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ BULBS_IOT_VARIABLE_TEMP = {
|
|||||||
"KL135",
|
"KL135",
|
||||||
"KL430",
|
"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_COLOR = {"LB130", "KL125", "KL130", "KL135", *BULBS_IOT_LIGHT_STRIP}
|
||||||
BULBS_IOT_DIMMABLE = {"KL50", "KL60", "LB100", "LB110", "KL110", "KL110B"}
|
BULBS_IOT_DIMMABLE = {"KL50", "KL60", "LB100", "LB110", "KL110", "KL110B"}
|
||||||
BULBS_IOT = (
|
BULBS_IOT = (
|
||||||
@@ -274,16 +277,23 @@ dimmable_iot = parametrize("dimmable", model_filter=DIMMABLE, protocol_filter={"
|
|||||||
non_dimmable_iot = parametrize(
|
non_dimmable_iot = parametrize(
|
||||||
"non-dimmable", model_filter=BULBS - DIMMABLE, protocol_filter={"IOT"}
|
"non-dimmable", model_filter=BULBS - DIMMABLE, protocol_filter={"IOT"}
|
||||||
)
|
)
|
||||||
variable_temp = parametrize(
|
variable_temp_by_model = parametrize(
|
||||||
"variable color temp",
|
"variable color temp",
|
||||||
model_filter=BULBS_VARIABLE_TEMP,
|
model_filter=BULBS_VARIABLE_TEMP,
|
||||||
protocol_filter={"SMART", "IOT"},
|
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_temp = parametrize(
|
||||||
"non-variable color temp",
|
"non-variable color temp",
|
||||||
model_filter=BULBS - BULBS_VARIABLE_TEMP,
|
model_filter=BULBS - BULBS_VARIABLE_TEMP,
|
||||||
protocol_filter={"SMART", "IOT"},
|
protocol_filter={"SMART", "IOT"},
|
||||||
)
|
)
|
||||||
|
non_variable_temp = parametrize_subtract(non_variable_temp, variable_temp_by_fixture)
|
||||||
color_bulb = parametrize(
|
color_bulb = parametrize(
|
||||||
"color bulbs", model_filter=BULBS_COLOR, protocol_filter={"SMART", "IOT"}
|
"color bulbs", model_filter=BULBS_COLOR, protocol_filter={"SMART", "IOT"}
|
||||||
)
|
)
|
||||||
@@ -296,11 +306,14 @@ non_color_bulb = parametrize(
|
|||||||
color_bulb_iot = parametrize(
|
color_bulb_iot = parametrize(
|
||||||
"color bulbs iot", model_filter=BULBS_IOT_COLOR, protocol_filter={"IOT"}
|
"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",
|
"variable color temp iot",
|
||||||
model_filter=BULBS_IOT_VARIABLE_TEMP,
|
model_filter=BULBS_IOT_VARIABLE_TEMP,
|
||||||
protocol_filter={"IOT"},
|
protocol_filter={"IOT"},
|
||||||
)
|
)
|
||||||
|
variable_temp_iot = parametrize_combine(
|
||||||
|
[variable_temp_iot_by_model, variable_temp_by_fixture]
|
||||||
|
)
|
||||||
variable_temp_smart = parametrize(
|
variable_temp_smart = parametrize(
|
||||||
"variable color temp smart",
|
"variable color temp smart",
|
||||||
model_filter=BULBS_SMART_VARIABLE_TEMP,
|
model_filter=BULBS_SMART_VARIABLE_TEMP,
|
||||||
|
|||||||
98
tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json
vendored
Normal file
98
tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json
vendored
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user