From 57bdd284666dd2139ffa00b28745be9a7520278d Mon Sep 17 00:00:00 2001 From: Autumn Date: Tue, 12 May 2026 18:51:33 +0100 Subject: [config] added action types --- src/lib/config/actions.types.ts | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/lib/config/actions.types.ts (limited to 'src/lib/config/actions.types.ts') diff --git a/src/lib/config/actions.types.ts b/src/lib/config/actions.types.ts new file mode 100644 index 0000000..83d58a5 --- /dev/null +++ b/src/lib/config/actions.types.ts @@ -0,0 +1,57 @@ +// +// ~~~ action config types +// + + +// action "on" actions +export enum ACTION_ON_ACTION { + PRESS = "press" + MOTION = "motion" +} + +// action "on" type +export interface ActionOnType { + device: string, + action: ACTION_ON_ACTION +} + +// action "if" types +export enum ACTION_IF_TYPE { + ALL = "all" + ANY = "any" +} + +// action "if" status +export enum ACTION_IF_STATUS { + ON = "on" + OFF = "off" + TOGGLE = "toggle" +} + +// action "if" type +export interface ActionIfType { + device: string, + status: ACTION_IF_STATUS +} + +// action "do" actions +export enum ACTION_DO_ACTION { + ON = "on" + OFF = "off" + TOGGLE = "toggle" +} + +// action "do" type +export interface ActionDoType { + device: string, + action: ACTION_DO_ACTION +} + +// global action config +export default interface ActionsConfig { + name: string, + on: ActionOnType + ifType?: ACTION_IF_TYPE, + if?: ActionIfType, + do: ActionDoType[] +} -- cgit v1.3