-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
38 lines (34 loc) · 935 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export type AlpineDispatch = (event: string, data: Record<string, unknown>) => unknown
export type Init = () => () => Promise<void>
export type RuleID = string
export type ConditionID = 'fullscreen'
export type ConditionData = Record<string, string>
export type Condition = {
id: ConditionID
data?: ConditionData
}
export type Conditions = Condition[]
export type ActionID = 'scene-turn-on'
export type ActionEntityID = string
export type ActionData = Record<string, ActionEntityID | string>
export type Action = {
id: ActionID
data?: ActionData
}
export type Rule = {
id: RuleID
name: string
enabled: boolean
conditions: Conditions
actionOn: Action
actionOff: Action
}
export type Rules = Rule[]
export type Settings = {
apiBaseUrl: string
apiToken: string
}
export type HAData = Record<string, string>
export type HAResponse = Promise<unknown>
export type HADomain = string
export type HAService = string