feat: Add event-based automation triggers (#2537)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent b701366762
commit a31816c168
109 changed files with 4607 additions and 1623 deletions
+16
View File
@@ -0,0 +1,16 @@
import { HomeAssistant } from './types';
/**
* `HASSSource` is the observer-pattern API that `HASSManager` exposes for any
* long-lived code that needs to react to HASS changes. The listener fires on
* every non-null HASS push; `oldHass` is the previous value (null on first
* fire).
*/
export type HASSListener = (hass: HomeAssistant, oldHass: HomeAssistant | null) => void;
export type HASSUnlistenCallback = () => void;
export interface HASSSource {
getHASS(): HomeAssistant | null;
addListener(listener: HASSListener): HASSUnlistenCallback;
}