File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,12 @@ namespace ratgdo {
9090
9191 void DryContact::door_action (DoorAction action)
9292 {
93- if (action == DoorAction::OPEN && this ->door_state_ != DoorState::CLOSED ) {
94- ESP_LOGW (TAG, " The door is not closed . Ignoring door action: %s" , DoorAction_to_string (action));
93+ if (action == DoorAction::OPEN && this ->open_limit_reached_ ) {
94+ ESP_LOGW (TAG, " The door is already fully open . Ignoring door action: %s" , LOG_STR_ARG ( DoorAction_to_string (action) ));
9595 return ;
9696 }
97- if (action == DoorAction::CLOSE && this ->door_state_ != DoorState::OPEN ) {
98- ESP_LOGW (TAG, " The door is not open . Ignoring door action: %s" , DoorAction_to_string (action));
97+ if (action == DoorAction::CLOSE && this ->close_limit_reached_ ) {
98+ ESP_LOGW (TAG, " The door is already fully closed . Ignoring door action: %s" , LOG_STR_ARG ( DoorAction_to_string (action) ));
9999 return ;
100100 }
101101
Original file line number Diff line number Diff line change @@ -923,6 +923,7 @@ namespace ratgdo {
923923 dry_contact_open_sensor_ = dry_contact_open_sensor;
924924 dry_contact_open_sensor_->add_on_state_callback ([this ](bool sensor_value) {
925925 this ->protocol_ ->set_open_limit (sensor_value);
926+ this ->door_position = 1.0 ;
926927 });
927928 }
928929
@@ -931,6 +932,7 @@ namespace ratgdo {
931932 dry_contact_close_sensor_ = dry_contact_close_sensor;
932933 dry_contact_close_sensor_->add_on_state_callback ([this ](bool sensor_value) {
933934 this ->protocol_ ->set_close_limit (sensor_value);
935+ this ->door_position = 0.0 ;
934936 });
935937 }
936938
You can’t perform that action at this time.
0 commit comments