Add KL400L5 color temperature range#1719
Conversation
Add KL400L5(US) 1.0.11 fixture data with variable color temperature support and cover its supported color temperature range so the fallback warning is not emitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the device-specific color temperature range for validation instead of Click blocking values above 9000K before the library can validate them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Set the KL400L5 range to 2500-9000K based on the app-visible range and drop the model-specific warning test in favor of existing generic color temperature coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The KL400L5 model has older fixtures without variable color temperature and a newer firmware fixture with variable color temperature. Categorize the newer fixture by exact fixture name so generic variable and non-variable temperature tests cover the right cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1719 +/- ##
==========================================
+ Coverage 93.21% 93.29% +0.07%
==========================================
Files 157 157
Lines 9819 9932 +113
Branches 1005 1022 +17
==========================================
+ Hits 9153 9266 +113
+ Misses 472 471 -1
- Partials 194 195 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rytilahti
left a comment
There was a problem hiding this comment.
Thanks for the PR, @loganrosen! Just a quick question (inline) before merging it, would it be enough to add the new model to the already existing list of iot devices with color temperature controls?
| "KL135", | ||
| "KL430", | ||
| } | ||
| BULBS_IOT_VARIABLE_TEMP_FIXTURES = {"KL400L5(US)_1.0_1.0.11"} |
There was a problem hiding this comment.
Is there some reason this would not work if simply added to the BULBS_IOT_VARIABLE_TEMP?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a0ca7c6a-6019-45c6-b839-bc1e4d6171c8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a0ca7c6a-6019-45c6-b839-bc1e4d6171c8
Summary
Notes
Test plan
uv run pytest tests/test_bulb.py::test_non_variable_temp tests/test_bulb.py::test_try_set_colortemp tests/test_bulb.py::test_out_of_range_temperatureuv run pytest tests/test_bulb.py -k 'variable_temp or non_variable_temp'uv run pytest tests/iot/test_iotbulb.py -k 'unknown_temp_range or set_color_temp_transition' tests/test_cli.py -k color_temperatureuv run pre-commit run --files tests/device_fixtures.pyuv run pre-commit run --files kasa/iot/iotbulb.py tests/iot/test_iotbulb.py kasa/cli/light.py tests/test_cli.py 'tests/fixtures/iot/KL400L5(US)_1.0_1.0.11.json' SUPPORTED.md tests/device_fixtures.py