aboutsummaryrefslogtreecommitdiff
path: root/src/lib/config/actions.types.ts
diff options
context:
space:
mode:
authorAutumn <git@autumnfo.rest>2026-05-12 18:51:33 +0100
committerAutumn <git@autumnfo.rest>2026-05-12 18:51:33 +0100
commit57bdd284666dd2139ffa00b28745be9a7520278d (patch)
tree339552a3827a78731f1cd56ced93be8947bc0766 /src/lib/config/actions.types.ts
parenta8addc5aaaecca292b7d2bdc3a848a795329a3b4 (diff)
[config] added action types
Diffstat (limited to 'src/lib/config/actions.types.ts')
-rw-r--r--src/lib/config/actions.types.ts57
1 files changed, 57 insertions, 0 deletions
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[]
+}