This commit is contained in:
2026-02-16 00:39:28 -08:00
parent e16d7b62f6
commit 83002ff8b2
4 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
local M = {}
M.board = 'arduino:avr:uno'
M.port = '/dev/ttyUSB0'
M.baudrate =115200
return M

View File

@@ -40,7 +40,6 @@ static const int NUM_WIFI = sizeof(wifiNetworks) / sizeof(wifiNetworks[0]);
#define BLINK_INTERVAL_MS 500
#define STALE_MSG_THRESHOLD_S 600
#define NTP_SYNC_INTERVAL_MS 3600000
#define ALERT_TIMEOUT_MS 300000
#define WAKE_DISPLAY_MS 5000
#define TOUCH_DEBOUNCE_MS 300
#define HEARTBEAT_INTERVAL_MS 30000

View File

@@ -232,7 +232,6 @@ void DoorbellLogic::transitionTo(DeviceState newState) {
break;
case DeviceState::ALERTING:
_alertStart = now;
_alertStartEpoch = _lastEpoch; // <-- ADD: record NTP time of alert
_lastBlink = now;
_blinkState = false;
_screen.screen = ScreenID::ALERT;

View File

@@ -49,6 +49,11 @@ private:
unsigned long _lastHeartbeat = 0;
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
bool _pendingStatus = false;
String _pendStatusState;