From ad7a45288c72cda74bf92f90026d0cbc7d689ca3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 20:40:38 -0500 Subject: [PATCH] cleanups --- components/ratgdo/ratgdo.cpp | 6 +++--- components/ratgdo/ratgdo.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 0e73228..962a460 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -186,8 +186,8 @@ namespace ratgdo { motion = 0; // when the status message is read, reset motion state to 0|clear // obstruction = (byte1 >> 6) & 1; // unreliable due to the time it takes to register an obstruction ESP_LOGD(TAG, "Door: %d Light: %d Lock: %d Motion: %d Obstruction: %d", door, light, lock, motion, obstruction); - if (this->forceUpdate) { - this->forceUpdate = false; + if (this->forceUpdate_) { + this->forceUpdate_ = false; this->previousDoorState = DoorState::DOOR_STATE_UNKNOWN; this->previousLightState = LightState::LIGHT_STATE_UNKNOWN; this->previousLockState = LockState::LOCK_STATE_UNKNOWN; @@ -456,7 +456,7 @@ namespace ratgdo { void RATGDOComponent::query() { - this->forceUpdate = true; + this->forceUpdate_ = true; sendCommandAndSaveCounter(Commands::REBOOT2); } diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index 063dc96..1c41b1b 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -141,6 +141,7 @@ namespace ratgdo { protected: ESPPreferenceObject pref_; std::vector children_; + bool forceUpdate_ { false }; RATGDOStore store_ {}; InternalGPIOPin* output_gdo_pin_;