Compare commits

...

5 Commits

Author SHA1 Message Date
Paul Wieland e0bbca305b
Merge ee1a970647 into b7e5b356d7 2025-01-03 00:24:30 -08:00
Paul Wieland b7e5b356d7 update min-distance to 100mm 2024-12-31 15:27:34 -05:00
Paul Wieland 055a36d68d Add ota firmware download button 2024-12-31 11:37:39 -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
13 changed files with 32 additions and 18 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

@ -32,7 +32,6 @@ namespace ratgdo {
static const int CLEAR_PRESENCE = 60000; // how long to keep arriving/leaving active
static const int PRESENCE_DETECT_WINDOW = 300000; // how long to calculate presence after door state change
static const int MIN_DISTANCE = 20; // ignore bugs crawling on the distance sensor
void RATGDOComponent::setup()
{
@ -368,9 +367,6 @@ namespace ratgdo {
void RATGDOComponent::set_distance_measurement(int16_t distance)
{
if (distance > 0 && distance < MIN_DISTANCE)
return;
this->last_distance_measurement = distance;
// current value = [0], last value = [1]

View File

@ -6,6 +6,7 @@ namespace esphome {
namespace ratgdo {
static const char* const TAG = "ratgdo.sensor";
static const int MIN_DISTANCE = 100; // ignore bugs crawling on the distance sensor & dust protection film
void RATGDOSensor::setup()
{
@ -91,7 +92,7 @@ namespace ratgdo {
VL53L4CX_TargetRangeData_t *d = &pDistanceData->RangeData[i];
if (d->RangeStatus == 0) {
maxDistance = std::max(maxDistance, d->RangeMilliMeter);
maxDistance = maxDistance <= 25 ? -1 : maxDistance; // ignore the dust protection sticker
maxDistance = maxDistance <= MIN_DISTANCE ? -1 : maxDistance;
}
}

View File

@ -255,6 +255,9 @@
</div>
<p>
<form method="get" action="v32board-esp32/v32board-esp32.ota.bin" id="download_ota_form" style="float: right">
<button type="submit" style="padding: 8px 28px; font-size: 14px; border-radius: 4px; color: #fff; background-color: #03a9f4; border: none; box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);">Download OTA Firmware</button>
</form>
<esp-web-install-button></esp-web-install-button>
</p>
@ -310,6 +313,19 @@
}
}
function setOTAFirmwarePath(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
document.querySelector("#download_ota_form").action = xhr.response.builds[0].ota.path;
}
};
xhr.send();
};
document.querySelectorAll('div.radios input').forEach((radio) =>
radio.addEventListener("change", () => {
const button = document.querySelector("esp-web-install-button");
@ -337,6 +353,7 @@
}
button.manifest = `${hardware}${protocol}-manifest.json`;
setOTAFirmwarePath(button.manifest);
})
);

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