esphome-ratgdo/components/ratgdo/ratgdo_state.h

69 lines
1.5 KiB
C
Raw Permalink Normal View History

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
#include "enum.h"
#include <cstdint>
2023-06-07 15:06:51 +00:00
namespace esphome {
namespace ratgdo {
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.
ENUM(LightState, uint8_t,
(OFF, 0),
(ON, 1),
(UNKNOWN, 2))
LightState light_state_toggle(LightState state);
2023-06-07 15:06:51 +00:00
/// Enum for all states a the lock can be in.
ENUM(LockState, uint8_t,
(UNLOCKED, 0),
(LOCKED, 1),
(UNKNOWN, 2))
LockState lock_state_toggle(LockState state);
2023-06-07 15:06:51 +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.
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.
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.
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
} // namespace esphome