-
Notifications
You must be signed in to change notification settings - Fork 9
/
device-config-schema.coffee
195 lines (195 loc) · 5.85 KB
/
device-config-schema.coffee
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# #Shell device configuration options
module.exports = {
title: "pimatic-shell-execute device config schemas"
ShellSwitch: {
title: "ShellSwitch config options"
type: "object"
extensions: ["xConfirm", "xLink", "xOnLabel", "xOffLabel"]
properties:
onCommand:
description: "the command to execute for switching on"
type: "string"
offCommand:
description: "the command to execute for switching off"
type: "string"
getStateCommand:
description: "
the command to execute to get current state.
Can return on/off, true/false or 1/0 as string
"
type: "string"
required: false
interval:
description: "
the time in ms, the command gets executed to get the actual state.
If 0 then the state will not updated automatically.
"
type: "integer"
default: 0
forceExecution:
description: "
always execute command even if switch already is set to the requested state
"
type: "boolean"
default: false
evaluateCommandStrings:
description: "
treat commands strings as pimatic expressions
"
type: "boolean"
default: false
}
ShellButtons: {
title: "ShellButtons config options"
type: "object"
extensions: ["xLink"]
properties:
buttons:
description: "Buttons and their actions once they are pressed"
type: "array"
default: []
format: "table"
items:
type: "object"
properties:
id:
description: "ID for the button"
type: "string"
text:
description: "Label for the button"
type: "string"
onPress:
description: "
Shell command to be executed, when the button is
pressed
"
type: "string"
confirm:
description: "Ask the user to confirm the button press"
type: "boolean"
default: false
evaluateCommandStrings:
description: "
treat commands strings as pimatic expressions
"
type: "boolean"
default: false
}
ShellSensor: {
title: "ShellSensor config options"
type: "object"
extensions: ["xLink"]
properties:
attributeName:
description: "the name of the attribute the sensor is monitoring"
type: "string"
attributeType:
description: "the type of the attribute the sensor is monitoring"
type: "string"
enum: ["string", "number"]
default: "string"
attributeUnit:
description: "this unit of the attribute the sensor is monitoring"
type: "string"
default: ""
attributeAcronym:
description: "this acronym of the attribute the sensor is monitoring"
type: "string"
default: ""
discrete:
description: "
Should be set to true if the value does not change continuously over time.
"
type: "boolean"
required: false
command:
description: "the command to execute and read the attribute value from stdout"
type: "string"
default: "echo value"
interval:
description: "the time in ms, the command gets executed to get a new sensor value"
type: "integer"
default: 5000
evaluateCommandStrings:
description: "
treat commands strings as pimatic expressions
"
type: "boolean"
default: false
}
ShellPresenceSensor: {
title: "ShellPresenceSensor config options"
type: "object"
extensions: ["xLink", "xPresentLabel", "xAbsentLabel"]
properties:
command:
description: "
the command to execute to get the presence state.
Can return on/off, true/false or 1/0 as string
"
type: "string"
default: "echo false"
interval:
description: "
the time in ms, the command gets executed to get the actual state.
If 0 then the state will not updated automatically.
"
type: "integer"
default: 0
autoReset:
description: "
if true and the the device is present, reset the state to absent
after resetTime has been reached.
"
type: "boolean"
default: false
resetTime:
description: "
Time in milliseconds after that the presence value is
reset to absent.
"
type: "integer"
default: 10000
evaluateCommandStrings:
description: "
treat commands strings as pimatic expressions
"
type: "boolean"
default: false
}
ShellShutterController: {
title: "ShellShutterController config options"
type: "object"
extensions: ["xConfirm", "xLink"]
properties:
upCommand:
description: "the command to execute to move the shutter up"
type: "string"
downCommand:
description: "the command to execute to move the shutter down"
type: "string"
stopCommand:
description: "the command to execute to stop the shutter"
type: "string"
getPositionCommand:
description: "
the command to execute to get current position.
Can return up/on, down/off or stopped/stop as string
"
type: "string"
required: false
interval:
description: "
the time in ms, the command gets executed to get the actual state.
If 0 then the state will not updated automatically.
"
type: "integer"
default: 0
evaluateCommandStrings:
description: "
treat commands strings as pimatic expressions
"
type: "boolean"
default: false
}
}