This commit is contained in:
J. Nick Koston 2023-06-09 19:40:09 -05:00
parent 040364c10d
commit fb9bff6a05
No known key found for this signature in database
1 changed files with 6 additions and 3 deletions

View File

@ -105,10 +105,12 @@ namespace ratgdo {
ESP_LOGD(TAG, "Door: %d Light: %d Lock: %d", this->doorState, this->lightState, this->lockState);
} else if (cmd == 0x281) {
this->lightState ^= 1; // toggle bit
if (this->lightState == LightState::LIGHT_STATE_ON) {
this->lightState = LightState::LIGHT_STATE_OFF;
} else {
this->lightState = LightState::LIGHT_STATE_ON;
}
ESP_LOGD(TAG, "Light: %d (toggle)", this->lightState);
} else if (cmd == 0x84) {
ESP_LOGD(TAG, "Unknown 0x84");
} else if (cmd == 0x284) {
this->motorState = MotorState::MOTOR_STATE_ON;
} else if (cmd == 0x280) {
@ -121,6 +123,7 @@ namespace ratgdo {
this->motionState = MotionState::MOTION_STATE_DETECTED; // toggle bit
ESP_LOGD(TAG, "Motion: %d (toggle)", this->motionState);
} else {
// 0x84 -- is it used?
ESP_LOGD(TAG, "Unknown command: %04x", cmd);
}
return cmd;