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,