Initialize color temperature to value within range if possible (#2168)

This commit is contained in:
Oxan van Leeuwen 2021-08-17 04:02:38 +02:00 committed by Jesse Hills
parent 8bf0448f41
commit 9ee3463d07
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -39,6 +39,13 @@ void LightState::setup() {
effect->init_internal(this);
}
// When supported color temperature range is known, initialize color temperature setting within bounds.
float min_mireds = this->get_traits().get_min_mireds();
if (min_mireds > 0) {
this->remote_values.set_color_temperature(min_mireds);
this->current_values.set_color_temperature(min_mireds);
}
auto call = this->make_call();
LightStateRTCState recovered{};
switch (this->restore_mode_) {