Skip to content

Commit 94fa006

Browse files
committed
Set door state to OPEN after position STOP
Use position float instead of 1.0 for open state
1 parent 05967a5 commit 94fa006

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/ratgdo/cover/ratgdo_cover.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace ratgdo {
3030
bool save_to_flash = true;
3131
switch (state) {
3232
case DoorState::OPEN:
33-
this->position = COVER_OPEN;
3433
this->current_operation = COVER_OPERATION_IDLE;
34+
this->position = position;
3535
break;
3636
case DoorState::CLOSED:
3737
this->position = COVER_CLOSED;

components/ratgdo/ratgdo.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ namespace ratgdo {
183183
this->cancel_position_sync_callbacks();
184184
cancel_timeout("door_query_state");
185185
} else if (door_state == DoorState::OPEN) {
186-
this->door_position = 1.0;
186+
this->door_position_update();
187187
this->cancel_position_sync_callbacks();
188188
} else if (door_state == DoorState::CLOSED) {
189189
this->door_position = 0.0;
@@ -626,6 +626,9 @@ namespace ratgdo {
626626
this->door_action(delta > 0 ? DoorAction::OPEN : DoorAction::CLOSE);
627627
set_timeout("move_to_position", operation_time, [=] {
628628
this->door_action(DoorAction::STOP);
629+
this->received(DoorState::OPEN);
630+
this->door_position_update();
631+
this->cancel_position_sync_callbacks();
629632
});
630633
}
631634

0 commit comments

Comments
 (0)