This commit is contained in:
J. Nick Koston 2023-06-07 20:39:20 -05:00
parent f3fb14d421
commit 1d8fdd73f4
No known key found for this signature in database
1 changed files with 7 additions and 3 deletions

View File

@ -186,6 +186,12 @@ 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;
this->previousDoorState = DoorState::DOOR_STATE_UNKNOWN;
this->previousLightState = LightState::LIGHT_STATE_UNKNOWN;
this->previousLockState = LockState::LOCK_STATE_UNKNOWN;
}
} else if (cmd == 0x281) {
light ^= 1; // toggle bit
@ -450,9 +456,7 @@ namespace ratgdo {
void RATGDOComponent::query()
{
this->previousDoorState = DoorState::DOOR_STATE_UNKNOWN;
this->previousLightState = LightState::LIGHT_STATE_UNKNOWN;
this->previousLockState = LockState::LOCK_STATE_UNKNOWN;
this->forceUpdate = true;
sendCommandAndSaveCounter(Commands::REBOOT2);
}