From d4f0389372b970a7d97f6e133a20ab69f0b7ef70 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 19:39:03 -0500 Subject: [PATCH] cleanups --- components/ratgdo/light/ratgdo_light_output.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/ratgdo/light/ratgdo_light_output.cpp b/components/ratgdo/light/ratgdo_light_output.cpp index fea828e..c92a3a5 100644 --- a/components/ratgdo/light/ratgdo_light_output.cpp +++ b/components/ratgdo/light/ratgdo_light_output.cpp @@ -32,8 +32,9 @@ namespace ratgdo { void RATGDOLightOutput::write_state(light::LightState* state) { bool binary; + bool current_state = state == LightState::LIGHT_STATE_ON; state->current_values_as_binary(&binary); - if (binary == state == LightState::LIGHT_STATE_ON) + if (binary == current_state) return; if (binary) { ESP_LOGD(TAG, "output call lightOn");