This commit is contained in:
J. Nick Koston 2023-06-09 16:51:34 -05:00
parent 32f76632c7
commit bd6c3504fe
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@ namespace ratgdo {
{
ESP_LOGD(TAG, "on_light_state: %d", state);
if (this->light_state_) {
this->has_initial_state_ = true;
set_state(state);
}
}
@ -44,6 +45,8 @@ namespace ratgdo {
void RATGDOLightOutput::write_state(light::LightState* state)
{
if (!this->has_initial_state_)
return;
bool binary;
state->current_values_as_binary(&binary);
if (binary) {

View File

@ -22,6 +22,7 @@ namespace ratgdo {
protected:
light::LightState* light_state_;
bool has_initial_state_ = false;
};
} // namespace ratgdo