Fix door close without obstruction sensor
With the old code, the door would not close the door when stopped, if you don't have the obstruction sensor connect (e.g door stopped)
This commit is contained in:
parent
2b46c587fc
commit
60881341d8
|
@ -462,9 +462,13 @@ namespace ratgdo {
|
||||||
|
|
||||||
if (this->obstruction_sensor_detected_) {
|
if (this->obstruction_sensor_detected_) {
|
||||||
this->door_action(DoorAction::CLOSE);
|
this->door_action(DoorAction::CLOSE);
|
||||||
} else if (*this->door_state == DoorState::OPEN) {
|
} else {
|
||||||
ESP_LOGD(TAG, "No obstruction sensors detected. Close using TOGGLE.");
|
if (*this->door_state == DoorState::OPEN || *this->door_state == DoorState::STOPPED) {
|
||||||
this->door_action(DoorAction::TOGGLE);
|
ESP_LOGD(TAG, "No obstruction sensors detected. Close using TOGGLE.");
|
||||||
|
this->door_action(DoorAction::TOGGLE);
|
||||||
|
} else {
|
||||||
|
this->door_action(DoorAction::CLOSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*this->closing_duration > 0) {
|
if (*this->closing_duration > 0) {
|
||||||
|
|
Loading…
Reference in New Issue