FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add KL400L5 color temperature range by loganrosen · Pull Request #1719 · python-kasa/python-kasa · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (1) .md  (1) .py  (2) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions SUPPORTED.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
1 change: 1 addition & 0 deletions kasa/iot/iotbulb.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class TurnOnBehaviors(DataClassDictMixin):
"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),
}

Expand Down
17 changes: 15 additions & 2 deletions tests/device_fixtures.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"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"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is there some reason this would not work if simply added to the BULBS_IOT_VARIABLE_TEMP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Adding KL400L5 to BULBS_IOT_VARIABLE_TEMP would select every KL400L5 fixture by model. The 1.0.5 and 1.0.8 fixtures report is_variable_color_temp: 0, while only 1.0.11 reports 1. The exact fixture filter keeps the older firmware fixtures in non_variable_temp and includes only 1.0.11 in the variable-temperature tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the clarification, makes sense! Could you add a quick comment on this in the file, so it's clear also for future readers?

loganrosen Jul 15, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Added a comment explaining that the KL400L5 firmware 1.0.5 and 1.0.8 fixtures report no variable color-temperature support, while the 1.0.11 fixture does, so the supporting fixture is matched exactly rather than categorizing the entire model.

BULBS_IOT_COLOR = {"LB130", "KL125", "KL130", "KL135", *BULBS_IOT_LIGHT_STRIP}
BULBS_IOT_DIMMABLE = {"KL50", "KL60", "LB100", "LB110", "KL110", "KL110B"}
BULBS_IOT = (
Expand Down Expand Up @@ -273,16 +276,23 @@ def parametrize(
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"}
)
Expand All @@ -295,11 +305,14 @@ def 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,
Expand Down
98 changes: 98 additions & 0 deletions tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

Back | FazBrowse Home | New Git URL