feat: Add hardened error handling and retries (#2451)

- Closes #1830
 - Closes #2099
This commit is contained in:
Dermot Duffy
2026-06-30 17:45:12 -07:00
committed by dermotduffy
parent 4bc787e2b7
commit 47bcce93d3
182 changed files with 7877 additions and 4043 deletions
+15 -1
View File
@@ -64,7 +64,7 @@ export class TriggersManager {
const hass = this._api.getHASSManager().getHASS();
let triggered = false;
let startupActionEvent: CameraEvent | null = null;
this._states.clear();
this.reset();
for (const [cameraID, camera] of this._api
.getCameraManager()
@@ -395,6 +395,20 @@ export class TriggersManager {
}
}
private _stopAllTimers(): void {
for (const [cameraID] of this._states) {
this._deleteUntriggerDelayTimer(cameraID);
this._deleteForceUntriggerTimer(cameraID);
}
}
public reset(): void {
this._throttledTriggerAction.cancel();
this._stopAllTimers();
this._states.clear();
this._setConditionStateIfNecessary();
}
private _isStateTriggered(state: CameraTriggerState): boolean {
return !!(state.sources.size || state.untriggerDelayTimer);
}