Compare commits
5 Commits
575b4bd3f3
...
e0bbca305b
Author | SHA1 | Date |
---|---|---|
Paul Wieland | e0bbca305b | |
Paul Wieland | b7e5b356d7 | |
Paul Wieland | 055a36d68d | |
Paul Wieland | ee1a970647 | |
Paul Wieland | fda14ac1b5 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,10 @@
|
|||
</div>
|
||||
|
||||
<p>
|
||||
<esp-web-install-button></esp-web-install-button>
|
||||
<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);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue