Compare commits

..

1 Commits

Author SHA1 Message Date
Paul Wieland 575b4bd3f3
Merge ee1a970647 into 494af2b067 2024-12-30 23:02:32 +11:00
3 changed files with 6 additions and 20 deletions

View File

@ -32,6 +32,7 @@ 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()
{
@ -367,6 +368,9 @@ 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,7 +6,6 @@ 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()
{
@ -92,7 +91,7 @@ namespace ratgdo {
VL53L4CX_TargetRangeData_t *d = &pDistanceData->RangeData[i];
if (d->RangeStatus == 0) {
maxDistance = std::max(maxDistance, d->RangeMilliMeter);
maxDistance = maxDistance <= MIN_DISTANCE ? -1 : maxDistance;
maxDistance = maxDistance <= 25 ? -1 : maxDistance; // ignore the dust protection sticker
}
}

View File

@ -255,10 +255,7 @@
</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>
<esp-web-install-button></esp-web-install-button>
</p>
@ -313,19 +310,6 @@
}
}
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");
@ -353,7 +337,6 @@
}
button.manifest = `${hardware}${protocol}-manifest.json`;
setOTAFirmwarePath(button.manifest);
})
);