mirror of
https://github.com/esphome/esphome.git
synced 2024-11-07 09:31:10 +01:00
Initialize color temperature to value within range if possible (#2168)
This commit is contained in:
parent
9b48ff5775
commit
0c370d5897
@ -39,6 +39,13 @@ void LightState::setup() {
|
|||||||
effect->init_internal(this);
|
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();
|
auto call = this->make_call();
|
||||||
LightStateRTCState recovered{};
|
LightStateRTCState recovered{};
|
||||||
switch (this->restore_mode_) {
|
switch (this->restore_mode_) {
|
||||||
|
Loading…
Reference in New Issue
Block a user