21 lines
863 B
TypeScript
21 lines
863 B
TypeScript
|
|
export * from './classes.automationcontext.js';
|
||
|
|
export * from './classes.agentproxy.js';
|
||
|
|
export * from './classes.deviceproxy.js';
|
||
|
|
|
||
|
|
import type * as shxInterfaces from '@smarthome.exchange/interfaces';
|
||
|
|
import { ShxAutomationContext, type TAutomationHandler } from './classes.automationcontext.js';
|
||
|
|
import { AgentProxy } from './classes.agentproxy.js';
|
||
|
|
import { DeviceProxy } from './classes.deviceproxy.js';
|
||
|
|
|
||
|
|
export const defaultAutomationContext = new ShxAutomationContext({
|
||
|
|
callerId: 'automation:default',
|
||
|
|
});
|
||
|
|
|
||
|
|
export const on: (
|
||
|
|
triggerArg: shxInterfaces.data.IAutomationTrigger,
|
||
|
|
handlerArg: TAutomationHandler
|
||
|
|
) => shxInterfaces.data.IAutomationTrigger = defaultAutomationContext.on.bind(defaultAutomationContext);
|
||
|
|
|
||
|
|
export const devices: DeviceProxy = defaultAutomationContext.devices;
|
||
|
|
export const agents: AgentProxy = defaultAutomationContext.agents;
|