Fix nightlight support detection #36656
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Skip check from model specs, for nightlight support. It was added previously, to add offline devices correctly ( if configured model type supported nightlight, it was added ). Now after supporting unique_id we don't have to do that, and we should fall back to query device about its properties.
It would be good to include it in 0.111.1 , as it fixes regression from 0.111.0 in some cases.
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Before using device capabilities, if model was not set, removed if was false, as model was not set. Now model is always set, because of get_capabilities call, populating device model ( https://gitlab.com/stavros/python-yeelight/-/blob/master/yeelight/main.py#L344 ). So if model was not described here: https://gitlab.com/stavros/python-yeelight/-/blob/master/yeelight/main.py#L29 , for supporting night light, it was assumed to not support nightlight, even when model was not set by hand.
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: