Compare commits

...

4 Commits

Author SHA1 Message Date
Paul Wieland dbf0a86cc9
Merge ee1a970647 into 89a5c28a32 2024-12-29 14:22:27 -05:00
Paul Wieland 89a5c28a32 Change maxDistance
former logic assumed it was the last distance found, which turns out to not always be the case. Implementing @dkerr64 logic from https://github.com/ratgdo/homekit-ratgdo32/pull/16
2024-12-27 12:56:13 -05:00
Paul Wieland ee1a970647 ref: main 2024-11-12 13:47:57 -05:00
Paul Wieland fda14ac1b5 revert build to main branch 2024-11-12 13:45:54 -05:00
11 changed files with 21 additions and 14 deletions

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- ratgdo32
- main
pull_request:
schedule:
- cron: '0 4 * * 1'
@ -97,7 +97,7 @@ jobs:
consolidate:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/ratgdo32'
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
name: Consolidate firmwares
runs-on: ubuntu-latest
needs: build
@ -119,7 +119,7 @@ jobs:
path: output
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/ratgdo32'
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: consolidate

View File

@ -3,7 +3,7 @@ external_components:
- source:
type: git
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
refresh: 1s
# - source:
# type: local

View File

@ -4,7 +4,7 @@ external_components:
- source:
type: git
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
refresh: 1s
# - source:
# type: local

View File

@ -4,7 +4,7 @@ external_components:
- source:
type: git
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
refresh: 1s
# - source:
# type: local

View File

@ -87,12 +87,19 @@ namespace ratgdo {
status = this->distance_sensor_.VL53L4CX_GetMultiRangingData(pDistanceData);
objCount = pDistanceData->NumberOfObjectsFound;
maxDistance = objCount == 0 ? -1 : pDistanceData->RangeData[objCount - 1].RangeMilliMeter;
for (int i = 0; i < distanceData.NumberOfObjectsFound; i++) {
VL53L4CX_TargetRangeData_t *d = &pDistanceData->RangeData[i];
if (d->RangeStatus == 0) {
maxDistance = std::max(maxDistance, d->RangeMilliMeter);
}
}
//maxDistance = objCount == 0 ? -1 : pDistanceData->RangeData[objCount - 1].RangeMilliMeter;
/*
* if the sensor is pointed at glass, there are many error -1 readings which will fill the
* vector with out of range data. The sensor should be sensitive enough to detect the floor
* in most situations, but daylight and/or really high ceilings can cause long distance
* measurements to be out of range.
* measurements to be out of range.
*/
this->parent_->set_distance_measurement(maxDistance);

View File

@ -30,7 +30,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base.yaml]
refresh: 1s
# remote_package: !include

View File

@ -29,7 +29,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base_drycontact.yaml]
refresh: 1s
# remote_package: !include

View File

@ -30,7 +30,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base_secplusv1.yaml]
refresh: 1s
# remote_package: !include

View File

@ -30,7 +30,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base.yaml]
refresh: 1s
# remote_package: !include

View File

@ -29,7 +29,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base_drycontact.yaml]
refresh: 1s
# remote_package: !include

View File

@ -30,7 +30,7 @@ dashboard_import:
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
ref: ratgdo32
ref: main
files: [base_secplusv1.yaml]
refresh: 1s
# remote_package: !include