get rid of strings
This commit is contained in:
parent
5c232579ea
commit
b06cfcfaa6
|
@ -552,7 +552,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::openDoor()
|
||||
{
|
||||
if (this->store_.doorState == DoorState.DOOR_STATE_OPEN || this->store_.doorState == DoorState.DOOR_STATE_OPENING) {
|
||||
if (this->store_.doorState == DoorState::DOOR_STATE_OPEN || this->store_.doorState == DoorState::DOOR_STATE_OPENING) {
|
||||
ESP_LOGD(TAG, "The door is already %s", door_state_to_string(this->store_.doorState));
|
||||
return;
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::closeDoor()
|
||||
{
|
||||
if (this->store_.doorState == DoorState.DOOR_STATE_CLOSED || this->store_.doorState == DoorState.DOOR_STATE_CLOSING) {
|
||||
if (this->store_.doorState == DoorState::DOOR_STATE_CLOSED || this->store_.doorState == DoorState::DOOR_STATE_CLOSING) {
|
||||
ESP_LOGD(TAG, "The door is already %s", door_state_to_string(this->store_.doorState));
|
||||
return;
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::stopDoor()
|
||||
{
|
||||
if (this->store_.doorState == DoorState.DOOR_STATE_OPENING || this->store_.doorState == DoorState.DOOR_STATE_CLOSING) {
|
||||
if (this->store_.doorState == DoorState::DOOR_STATE_OPENING || this->store_.doorState == DoorState::DOOR_STATE_CLOSING) {
|
||||
toggleDoor();
|
||||
} else {
|
||||
ESP_LOGD(TAG, "The door is not moving.");
|
||||
|
@ -587,7 +587,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::lightOn()
|
||||
{
|
||||
if (this->store_.lightState == LightState.LIGHT_STATE_ON) {
|
||||
if (this->store_.lightState == LightState::LIGHT_STATE_ON) {
|
||||
ESP_LOGD(TAG, "already on");
|
||||
} else {
|
||||
toggleLight();
|
||||
|
@ -596,7 +596,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::lightOff()
|
||||
{
|
||||
if (this->store_.lightState == LightState.LIGHT_STATE_OFF) {
|
||||
if (this->store_.lightState == LightState::LIGHT_STATE_OFF) {
|
||||
ESP_LOGD(TAG, "already off");
|
||||
} else {
|
||||
toggleLight();
|
||||
|
@ -611,7 +611,7 @@ namespace ratgdo {
|
|||
// Lock functions
|
||||
void RATGDOComponent::lock()
|
||||
{
|
||||
if (this->store_.lockState == LockState.LOCK_STATE_LOCKED) {
|
||||
if (this->store_.lockState == LockState::LOCK_STATE_LOCKED) {
|
||||
ESP_LOGD(TAG, "already locked");
|
||||
} else {
|
||||
toggleLock();
|
||||
|
@ -620,7 +620,7 @@ namespace ratgdo {
|
|||
|
||||
void RATGDOComponent::unlock()
|
||||
{
|
||||
if (this->store_.lockState == LockState.LOCK_STATE_UNLOCKED) {
|
||||
if (this->store_.lockState == LockState::LOCK_STATE_UNLOCKED) {
|
||||
ESP_LOGD(TAG, "already unlocked");
|
||||
} else {
|
||||
toggleLock();
|
||||
|
|
|
@ -79,11 +79,11 @@ namespace ratgdo {
|
|||
int obstructionLowCount = 0; // count obstruction low pulses
|
||||
long lastObstructionHigh = 0; // count time between high pulses from the obst ISR
|
||||
|
||||
uint8_t obstructionState = ObstructionState.OBSTRUCTION_STATE_UNKNOWN;
|
||||
uint8_t motionState = MotionState.MOTION_STATE_CLEAR;
|
||||
uint8_t lockState = LockState.LOCK_STATE_UNKNOWN;
|
||||
uint8_t lightState = LightState.LIGHT_STATE_UNKNOWN;
|
||||
uint8_t doorState = DoorState.DOOR_STATE_UNKNOWN;
|
||||
uint8_t obstructionState { ObstructionState::OBSTRUCTION_STATE_UNKNOWN };
|
||||
uint8_t motionState { MotionState::MOTION_STATE_CLEAR };
|
||||
uint8_t lockState { LockState::LOCK_STATE_UNKNOWN };
|
||||
uint8_t lightState { LightState::LIGHT_STATE_UNKNOWN };
|
||||
uint8_t doorState { DoorState::DOOR_STATE_UNKNOWN };
|
||||
|
||||
static void IRAM_ATTR isrDoorOpen(RATGDOStore* arg);
|
||||
static void IRAM_ATTR isrDoorClose(RATGDOStore* arg);
|
||||
|
|
Loading…
Reference in New Issue