From 1ac1c54841a57c111924d13f57cc03ca4493c7cf Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Jun 2023 18:22:50 -0500 Subject: [PATCH] button --- components/ratgdo/ratgdo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index a5e4578..cfd1ac5 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -110,7 +110,7 @@ namespace ratgdo { } else if (cmd == 0x84) { ESP_LOGD(TAG, "Unknown 0x84"); } else if (cmd == 0x284) { - motor = 1; + motor = MotorState::MOTOR_STATE_ON; } else if (cmd == 0x280) { button = byte1 == 1 ? ButtonState::BUTTON_STATE_PRESSED : ButtonState::BUTTON_STATE_RELEASED; ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released"); @@ -118,7 +118,7 @@ namespace ratgdo { openings = (byte1 << 8) | byte2; ESP_LOGD(TAG, "Openings: %d", (byte1 << 8) | byte2); } else if (cmd == 0x285) { - motion = 1; // toggle bit + motion = MotionState::MOTION_STATE_DETECTED; // toggle bit ESP_LOGD(TAG, "Motion: %d (toggle)", motion); } else { ESP_LOGD(TAG, "Unknown command: %04x", cmd);