From 155ff6d809b3b1a0ce97a326301b70627a501069 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 10:07:15 -0500 Subject: [PATCH] get rid of strings --- components/ratgdo/ratgdo.cpp | 1 + components/ratgdo/ratgdo.h | 39 ------------------------------------ 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 018b8db..c211f95 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -13,6 +13,7 @@ #include "ratgdo.h" #include "ratgdo_child.h" +#include "ratgdo_state.h" #include "esphome/core/log.h" diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index 3c54a30..1f898d5 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -31,45 +31,6 @@ namespace ratgdo { // Forward declare RATGDOClient class RATGDOClient; - /// Enum for all states a the door can be in. - enum DoorState : uint8_t { - DOOR_STATE_UNKNOWN = 0, - DOOR_STATE_OPEN = 1, - DOOR_STATE_CLOSED = 2, - DOOR_STATE_STOPPED = 3, - DOOR_STATE_OPENING = 4, - DOOR_STATE_CLOSING = 5 - }; - const char* door_state_to_string(DoorState state); - - /// Enum for all states a the light can be in. - enum LightState : uint8_t { - LIGHT_STATE_OFF = 0, - LIGHT_STATE_ON = 1, - LIGHT_STATE_UNKNOWN = 2, - }; - const char* light_state_to_string(LightState state); - - /// Enum for all states a the lock can be in. - enum LockState : uint8_t { - LOCK_STATE_UNLOCKED = 0, - LOCK_STATE_LOCKED = 1, - LOCK_STATE_UNKNOWN = 2, - }; - - /// Enum for all states a the motion can be in. - enum MotionState : uint8_t { - MOTION_STATE_CLEAR = 0, - MOTION_STATE_DETECTED = 1, - }; - - /// Enum for all states a the obstruction can be in. - enum ObstructionState : uint8_t { - OBSTRUCTION_STATE_OBSTRUCTED = 0, - OBSTRUCTION_STATE_CLEAR = 1, - OBSTRUCTION_STATE_UNKNOWN = 2, - }; - enum Commands { REBOOT1, REBOOT2,