Migrate zwave_js light tests to use Kelvin#133034
Conversation
|
Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
| assert state.attributes[ATTR_COLOR_MODE] == "color_temp" | ||
| assert state.attributes[ATTR_BRIGHTNESS] == 255 | ||
| assert state.attributes[ATTR_COLOR_TEMP] == 370 | ||
| assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 2702 |
There was a problem hiding this comment.
Why is it 2702 instead of 2700 as above?
There was a problem hiding this comment.
2700 above is the "min kelvin" which gets set once
core/homeassistant/components/zwave_js/light.py
Lines 108 to 109 in 72cc1f4
2702 is the current value from the integration (looks like a % ratio converted to mireds)
core/homeassistant/components/zwave_js/light.py
Lines 498 to 500 in 72cc1f4
I see three options:
- the current code is kept with slight rounding discrepencies
- we can change the min/max from
2700/6500to2702/6535to more closely match the previous defaults - the formula is changed so the % ratio is based on Kelvin and not Mireds
There was a problem hiding this comment.
I'd use numbers in the tests that make sense when using Kelvin. It looks weird at the moment.
Proposed change
Based on #79591, needed for #132680
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: