get rid of strings

This commit is contained in:
J. Nick Koston 2023-06-07 09:32:23 -05:00
parent ccc1e7dae4
commit e97f7f30b8
No known key found for this signature in database
1 changed files with 6 additions and 6 deletions

View File

@ -453,10 +453,10 @@ namespace ratgdo {
void RATGDOComponent::statusUpdateLoop()
{
// initialize to unknown
static uint8_t previousDoorState = 0;
static uint8_t previousLightState = 2;
static uint8_t previousLockState = 2;
static uint8_t previousObstructionState = 2;
static uint8_t previousDoorState = DoorState::DOOR_STATE_UNKNOWN;
static uint8_t previousLightState = LightState::LIGHT_STATE_UNKNOWN;
static uint8_t previousLockState = LockState::LOCK_STATE_UNKNOWN;
static uint8_t previousObstructionState = ObstructionState::OBSTRUCTION_STATE_UNKNOWN;
if (this->store_.doorState != previousDoorState)
sendDoorStatus();
@ -467,9 +467,9 @@ namespace ratgdo {
if (this->store_.obstructionState != previousObstructionState)
sendObstructionStatus();
if (this->store_.motionState == 1) {
if (this->store_.motionState == MotionState::MOTION_STATE_DETECTED) {
sendMotionStatus();
this->store_.motionState = 0;
this->store_.motionState = MotionState::MOTION_STATE_CLEAR;
}
previousDoorState = this->store_.doorState;