Don't run automations prior to initialization .

This commit is contained in:
Dermot Duffy
2024-08-26 14:35:16 -07:00
parent 2a31d96120
commit 91ffe0656b
5 changed files with 60 additions and 11 deletions
+10 -5
View File
@@ -27,11 +27,16 @@ export class AutomationsManager {
}
public execute(): void {
const hass = this._api.getHASSManager().getHASS();
// Never execute automations if there's an error (as our automation loop
// avoidance -- which shows as an error -- would not work!).
if (!hass || this._api.getMessageManager().hasErrorMessage()) {
if (
!this._api.getHASSManager().hasHASS() ||
// Never execute automations if the card hasn't finished initializing, as
// it could cause a view change when camera loads are not finished.
// See: https://github.com/dermotduffy/frigate-hass-card/issues/1407
!this._api.getInitializationManager().isInitializedMandatory() ||
// Never execute automations if there's an error (as our automation loop
// avoidance -- which shows as an error -- would not work!).
this._api.getMessageManager().hasErrorMessage()
) {
return;
}