Skip to content

Commit

Permalink
GDO White: allow calibrated distance lower minimum of 1cm
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Dec 16, 2024
1 parent 39117b5 commit 8c1770c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion garage-door-GDOv1-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ substitutions:
name: konnected
friendly_name: Garage Door Opener
project_name: konnected.garage-door-gdov1-s
project_version: "1.2.2"
project_version: "1.2.3"
garage_door_cover_name: Garage Door
switch_name: Switch
warning_beep_name: Warning Beep
Expand Down
2 changes: 1 addition & 1 deletion garage-door-GDOv2-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ substitutions:
name: konnected
friendly_name: Garage Door Opener
project_name: konnected.garage-door-gdov2-s
project_version: "1.2.2"
project_version: "1.2.3"
garage_door_cover_name: Garage Door
switch_name: STR output

Expand Down
4 changes: 2 additions & 2 deletions packages/vl53l0x-range-sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ number:
device_class: distance
step: 0.01
max_value: 2.0
min_value: 0.1
min_value: 0.01
optimistic: true
restore_value: true

Expand Down Expand Up @@ -48,7 +48,7 @@ binary_sensor:
float calibrated_distance = id(open_garage_door_distance_from_ceiling).state;
if (std::isnan(id(range_sensor).state) || id(range_sensor).state > calibrated_distance + id(gdo_err_margin)) {
return false;
} else if (id(range_sensor).state > calibrated_distance - id(gdo_err_margin)){
} else if (id(range_sensor).state > std::max(calibrated_distance - id(gdo_err_margin),0.0f)){
return true;
} else {
return {};
Expand Down

0 comments on commit 8c1770c

Please sign in to comment.