Fix door requiring two close commands to close (#88)

This commit is contained in:
J. Nick Koston 2023-11-05 09:40:25 -06:00 committed by GitHub
parent 2091be8312
commit c09136da50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -540,12 +540,16 @@ namespace ratgdo {
this->door_state_received.then([=](DoorState s) {
if (s == DoorState::STOPPED) {
this->door_command(data::DOOR_CLOSE);
} else {
ESP_LOGW(TAG, "Door did not stop, ignoring close command");
}
});
return;
}
this->door_command(data::DOOR_CLOSE);
// Sometimes the door doesn't always close when its fully open
// so we use ensure_door_command to make sure it closes
this->ensure_door_command(data::DOOR_CLOSE);
}
void RATGDOComponent::stop_door()