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
+14
View File
@@ -0,0 +1,14 @@
import { vi } from 'vitest';
import { mock, MockProxy } from 'vitest-mock-extended';
import { SubscriptionHealthInterface } from '../../src/ha/connection/subscription-health-monitor';
// A benign mocked event-subscription health surface: no failures, listeners
// return a no-op unsubscribe. Tests configure `getFailures`/`retry` as needed.
export const createSubscriptionHealth = (): MockProxy<
SubscriptionHealthInterface<string>
> => {
const health = mock<SubscriptionHealthInterface<string>>();
health.getFailures.mockReturnValue([]);
health.addListener.mockReturnValue(vi.fn());
return health;
};