From aa26aefde3922cebfdb93411e0a8f4341a4fbf4d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Jun 2023 16:00:00 -0500 Subject: [PATCH] fix --- components/ratgdo/switch/ratgdo_switch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ratgdo/switch/ratgdo_switch.cpp b/components/ratgdo/switch/ratgdo_switch.cpp index f682c12..fdf911e 100644 --- a/components/ratgdo/switch/ratgdo_switch.cpp +++ b/components/ratgdo/switch/ratgdo_switch.cpp @@ -15,8 +15,9 @@ namespace ratgdo { void RATGDOSwitch::on_lock_state(LockState state) { - this->state(state == LockState::LOCK_STATE_LOCKED); - this->publish_state(); + bool value = state == LockState::LOCK_STATE_LOCKED; + this->state(value); + this->publish_state(value); } void RATGDOSwitch::write_state(bool state) { @@ -26,7 +27,6 @@ namespace ratgdo { } else { this->parent_->unlock(value); } - this->publish_state(value); } } // namespace ratgdo