2023-06-07 15:06:51 +00:00
|
|
|
/************************************
|
|
|
|
* Rage
|
|
|
|
* Against
|
|
|
|
* The
|
|
|
|
* Garage
|
|
|
|
* Door
|
|
|
|
* Opener
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022 Paul Wieland
|
|
|
|
*
|
|
|
|
* GNU GENERAL PUBLIC LICENSE
|
|
|
|
************************************/
|
|
|
|
|
|
|
|
#pragma once
|
2023-07-03 16:47:00 +00:00
|
|
|
#include "enum.h"
|
|
|
|
#include <cstdint>
|
2023-06-07 15:06:51 +00:00
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace ratgdo {
|
|
|
|
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(DoorState, uint8_t,
|
|
|
|
(UNKNOWN, 0),
|
|
|
|
(OPEN, 1),
|
|
|
|
(CLOSED, 2),
|
|
|
|
(STOPPED, 3),
|
|
|
|
(OPENING, 4),
|
|
|
|
(CLOSING, 5))
|
2023-06-07 15:06:51 +00:00
|
|
|
|
|
|
|
/// Enum for all states a the light can be in.
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(LightState, uint8_t,
|
|
|
|
(OFF, 0),
|
|
|
|
(ON, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-24 20:38:44 +00:00
|
|
|
LightState light_state_toggle(LightState state);
|
2023-06-07 15:06:51 +00:00
|
|
|
|
|
|
|
/// Enum for all states a the lock can be in.
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(LockState, uint8_t,
|
|
|
|
(UNLOCKED, 0),
|
|
|
|
(LOCKED, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-24 20:38:44 +00:00
|
|
|
LockState lock_state_toggle(LockState state);
|
2023-06-07 15:06:51 +00:00
|
|
|
|
2023-07-03 16:47:00 +00:00
|
|
|
/// MotionState for all states a the motion can be in.
|
|
|
|
ENUM(MotionState, uint8_t,
|
|
|
|
(CLEAR, 0),
|
|
|
|
(DETECTED, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-07 15:06:51 +00:00
|
|
|
|
|
|
|
/// Enum for all states a the obstruction can be in.
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(ObstructionState, uint8_t,
|
|
|
|
(OBSTRUCTED, 0),
|
|
|
|
(CLEAR, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-07 15:06:51 +00:00
|
|
|
|
2023-06-08 02:40:07 +00:00
|
|
|
/// Enum for all states a the motor can be in.
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(MotorState, uint8_t,
|
|
|
|
(OFF, 0),
|
|
|
|
(ON, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-08 02:40:07 +00:00
|
|
|
|
2023-06-09 23:04:29 +00:00
|
|
|
/// Enum for all states the button can be in.
|
2023-07-03 16:47:00 +00:00
|
|
|
ENUM(ButtonState, uint8_t,
|
|
|
|
(PRESSED, 0),
|
|
|
|
(RELEASED, 1),
|
|
|
|
(UNKNOWN, 2))
|
2023-06-09 23:04:29 +00:00
|
|
|
|
2023-06-07 15:06:51 +00:00
|
|
|
} // namespace ratgdo
|
2023-10-19 00:23:30 +00:00
|
|
|
} // namespace esphome
|