snapshot
This commit is contained in:
5
sketches/doorbell-touch-esp32-32e/.arduino_config.lua
Normal file
5
sketches/doorbell-touch-esp32-32e/.arduino_config.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
local M = {}
|
||||||
|
M.board = 'arduino:avr:uno'
|
||||||
|
M.port = '/dev/ttyUSB0'
|
||||||
|
M.baudrate =115200
|
||||||
|
return M
|
||||||
@@ -40,7 +40,6 @@ static const int NUM_WIFI = sizeof(wifiNetworks) / sizeof(wifiNetworks[0]);
|
|||||||
#define BLINK_INTERVAL_MS 500
|
#define BLINK_INTERVAL_MS 500
|
||||||
#define STALE_MSG_THRESHOLD_S 600
|
#define STALE_MSG_THRESHOLD_S 600
|
||||||
#define NTP_SYNC_INTERVAL_MS 3600000
|
#define NTP_SYNC_INTERVAL_MS 3600000
|
||||||
#define ALERT_TIMEOUT_MS 300000
|
|
||||||
#define WAKE_DISPLAY_MS 5000
|
#define WAKE_DISPLAY_MS 5000
|
||||||
#define TOUCH_DEBOUNCE_MS 300
|
#define TOUCH_DEBOUNCE_MS 300
|
||||||
#define HEARTBEAT_INTERVAL_MS 30000
|
#define HEARTBEAT_INTERVAL_MS 30000
|
||||||
|
|||||||
@@ -232,7 +232,6 @@ void DoorbellLogic::transitionTo(DeviceState newState) {
|
|||||||
break;
|
break;
|
||||||
case DeviceState::ALERTING:
|
case DeviceState::ALERTING:
|
||||||
_alertStart = now;
|
_alertStart = now;
|
||||||
_alertStartEpoch = _lastEpoch; // <-- ADD: record NTP time of alert
|
|
||||||
_lastBlink = now;
|
_lastBlink = now;
|
||||||
_blinkState = false;
|
_blinkState = false;
|
||||||
_screen.screen = ScreenID::ALERT;
|
_screen.screen = ScreenID::ALERT;
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ private:
|
|||||||
unsigned long _lastHeartbeat = 0;
|
unsigned long _lastHeartbeat = 0;
|
||||||
bool _blinkState = false;
|
bool _blinkState = false;
|
||||||
|
|
||||||
|
// Stale silence protection
|
||||||
|
time_t _alertMsgEpoch = 0; // ntfy timestamp of the alert that started ALERTING
|
||||||
|
time_t _lastParsedMsgEpoch = 0; // ntfy timestamp of message currently being handled
|
||||||
|
|
||||||
|
|
||||||
// Deferred status publish
|
// Deferred status publish
|
||||||
bool _pendingStatus = false;
|
bool _pendingStatus = false;
|
||||||
String _pendStatusState;
|
String _pendStatusState;
|
||||||
|
|||||||
Reference in New Issue
Block a user