fix: Stop PTZ movement and browser key handling from fighting (#2674)

- Closes: #2623
This commit is contained in:
Dermot Duffy
2026-08-10 14:49:50 -07:00
committed by GitHub
parent a8aa9ec7c2
commit 3808a1b030
20 changed files with 822 additions and 148 deletions
@@ -5,6 +5,7 @@ import type { ActionsExecutionRequest } from '../../src/card-controller/actions/
import { AutomationsManager } from '../../src/card-controller/automations-manager.js';
import type { EventWatcherSubscriptionInterface } from '../../src/card-controller/hass/event-watcher.js';
import { ConditionStateManager } from '../../src/condition-trigger/conditions/state-manager.js';
import type { Trigger } from '../../src/config/schema/condition-trigger/triggers/types.js';
import {
createCardAPI,
createHASS,
@@ -375,4 +376,27 @@ describe('AutomationsManager', () => {
stateManager.setState({ expand: true });
expect(api.getActionsManager().executeActions).toHaveBeenCalledTimes(2);
});
describe('should report the triggers it subscribes to', () => {
it('with no automations', () => {
expect(new AutomationsManager(createCardAPI()).getTriggers()).toEqual([]);
});
it('with automations', () => {
const keyTrigger: Trigger = { trigger: 'key', key: 'ArrowLeft' };
const expandTrigger: Trigger = { trigger: 'expand', expand: true };
const automationsManager = new AutomationsManager(createCardAPI());
automationsManager.addAutomations([
{ triggers: [keyTrigger, expandTrigger], actions },
{ triggers: triggers, actions },
]);
expect(automationsManager.getTriggers()).toEqual([
keyTrigger,
expandTrigger,
...triggers,
]);
});
});
});