-
Notifications
You must be signed in to change notification settings - Fork 2
/
device-config-schema.coffee
382 lines (382 loc) · 11.9 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
module.exports = {
title: "pimatic-johnny-five device config schemas"
JohnnyFivePwmOutput: {
title: "Johnny Five PWM Output"
description: "Johnny Five PWM Output"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
}
JohnnyFiveSwitch: {
title: "Johnny Five Switch"
description: "Johnny Five Switch"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
}
JohnnyFiveContactSensor: {
title: "Johnny Five Contact Sensor"
description: "Johnny Five Contact Sensor for a digital input"
type: "object"
extensions: ["xConfirm", "xLink", "xClosedLabel", "xOpenedLabel"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
invert:
description: "If true, invert the contact states, i.e. 'on' state on LOW. "
type: "boolean"
default: false
}
JohnnyFivePresenceSensor: {
title: "Johnny Five Presence Sensor"
description: "Johnny Five Presence Sensor for a digital input"
type: "object"
extensions: ["xLink", "xPresentLabel", "xAbsentLabel"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
invert:
description: "If true, invert the presence states, i.e. 'present' state on LOW. "
type: "boolean"
default: false
}
JohnnyFiveButton: {
title: "Johnny Five Button"
description: "Johnny Five Digital Input"
type: "object"
extensions: ["xLink", "xClosedLabel", "xOpenedLabel"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
pullUp:
description: "If true, activate the internal pull-up. As a result, a high signal will be read if push-button is open"
type: "boolean"
default: false
invert:
description: "If true, invert the button state."
type: "boolean"
default: false
holdTime:
description: "Time in milliseconds that the button must be held until triggering an event"
type: "number"
default: 500
controller:
description: "Controller interface type if an EVshield is used. Supports EVS_EV3 and EVS_NXT shields"
type: "string"
default: ""
}
JohnnyFiveRelay: {
title: "Johnny Five Relay"
description: "Johnny Five Relay"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
pin:
description: "The pin address"
type: "string"
type:
description: "Whether the relay is wired to be 'normally open' (NO), or 'normally closed' if pin output is LOW"
enum: ["NO", "NC"]
default: "NO"
}
JohnnyFiveTemperature: {
title: "Johnny Five Temperature"
description: "Johnny Five Temperature"
type: "object"
extensions: ["xLink", "xAttributeOptions"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "Controller interface type to be used, one of TINKERKIT, LM35, TMP36, DS18B20, MPU6050, GROVE, BMP180, MPL115A2, MPL3115A2, HTU21D, SI7020"
type: "string"
default: "TINKERKIT"
pin:
description: "The pin address. Required if controller is ANALOG, optional otherwise"
type: "string"
default: ""
address:
description: """
The I2C address. If controller is an I2C device and address is not provided the device-specfic
default address applies.
"""
type: "string"
default: ""
interval:
description: "The time interval in seconds at which the sensor will be read"
type: "number"
default: 10
units:
description: "Defines whether \"metric\", \"imperial\", or \"standard\" units shall be used"
format: "enum"
enum: ["metric", "imperial", "standard"]
default: "metric"
offset:
description: "A positive or negative offset value to adjust a deviation of the temperature sensor"
type: "number"
default: 0
}
JohnnyFiveTemperatureHumidity: {
title: "Johnny Five Temperature & Humidity"
description: "Johnny Five Temperature & Humidity"
type: "object"
extensions: ["xLink", "xAttributeOptions"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "Controller interface type to be used, one of ANALOG, LM35, TMP36, DS18B20, MPU6050, GROVE, BMP180, MPL115A2, MPL3115A2, HTU21D"
type: "string"
default: "ANALOG"
pin:
description: "The pin address. Required if controller is ANALOG, optional otherwise"
type: "string"
default: ""
address:
description: """
The I2C address. If controller is an I2C device and address is not provided the device-specfic
default address applies.
"""
type: "string"
default: ""
interval:
description: "The time interval in seconds at which the sensor will be read"
type: "number"
default: 10
units:
description: "Defines whether \"metric\", \"imperial\", or \"standard\" units shall be used"
format: "enum"
enum: ["metric", "imperial", "standard"]
default: "metric"
temperatureOffset:
description: "A positive or negative offset value to adjust a deviation of the temperature sensor"
type: "number"
default: 0
humidityOffset:
description: "A positive or negative offset value to adjust a deviation of the humidity sensor"
type: "number"
default: 0
}
JohnnyFiveTemperaturePressure: {
title: "Johnny Five Temperature & Pressure"
description: "Johnny Five Temperature & Pressure"
type: "object"
extensions: ["xLink", "xAttributeOptions"]
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "Controller interface type to be used, one of MS5611"
type: "string"
default: "MS5611"
pin:
description: "The pin address. Required if controller is ANALOG, optional otherwise"
type: "string"
default: ""
address:
description: """
The I2C address. If controller is an I2C device and address is not provided the device-specfic
default address applies.
"""
type: "string"
default: ""
interval:
description: "The time interval in seconds at which the sensor will be read"
type: "number"
default: 10
units:
description: "Defines whether \"metric\", \"imperial\", or \"standard\" units shall be used"
format: "enum"
enum: ["metric", "imperial", "standard"]
default: "metric"
temperatureOffset:
description: "A positive or negative offset value to adjust a deviation of the temperature sensor"
type: "number"
default: 0
pressureOffset:
description: "A positive or negative offset value to adjust a deviation of the humidity sensor"
type: "number"
default: 0
elevation:
description: "The elevation of the current location in meters"
type: "number"
default: 0
}
JohnnyFiveRgbLed: {
title: "Johnny Five RGB LED"
description: "Johnny Five RGB LED"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "Controller interface type. One of DEFAULT, PCA9685, BLINKM"
type: "string"
default: "DEFAULT"
pins:
description: "The pins assigned to the RGB LED"
type: "object"
properties:
red:
description: "The pin for red"
type: "string"
green:
description: "The green for green"
type: "string"
blue:
description: "The pin for blue"
type: "string"
isAnode:
description: "If set to true the LED is a common anode LED. Defaults to false, indicating a common cathode LED"
type: "boolean"
default: "false"
}
JohnnyFiveOledDisplay: {
title: "JohnnyFive LED"
description: "JohnnyFive LED"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
address:
description: "The I2C address. If omitted SPI mode is assumed"
type: "string"
default: ""
slavePin:
description: "The slave select pin used in SPI mode"
type: "string"
default: "12"
}
JohnnyFiveLcdDisplay: {
title: "JohnnyFive LED"
description: "JohnnyFive LED"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "The I2C controller. If omitted the parallel interface will be used."
type: "string"
default: ""
address:
description: "The I2C address. If omitted the default address will be used in I2C mode"
type: "string"
default: ""
pins:
description: "The comma separated list of pins used for the parallel interface."
type: "string"
default: ""
backlight:
description: "The pin driving the backlight for the parallel interface."
type: "string"
default: ""
rows:
description: "The number of rows on the device"
type: "number"
default: 2
cols:
description: "The number of columns on the device"
type: "number"
default: 16
}
JohnnyFiveServo: {
title: "JohnnyFive Servo"
description: "JohnnyFive Servo"
type: "object"
properties:
boardId:
description: "Id of the board to be used"
type: "string"
controller:
description: "Controller interface type: DEFAULT, PCA9685"
type: "string"
default: "DEFAULT"
address:
description: "The I2C address if controller is PCA9685. If omitted the default address will be used in I2C mode"
type: "string"
default: ""
pin:
description: "The pin address"
type: "string"
type:
description: "The type of servo, one of standard or continuous"
type: "string"
default: "standard"
range:
description: "The range of motion in degrees"
type: "array"
default: [
0,
180
]
format: "table"
items:
type: "number"
buttons:
description: "The inputs to select from"
type: "array"
default: [
{
id: "min"
}
{
id: "max"
}
{
id: "center"
}
{
id: "stop"
}
]
format: "table"
items:
type: "object"
properties:
id:
enum: [
"min", "max", "center", "home", "sweep", "stop", "cw", "ccw"
]
description: "The input ids switchable by the AVR"
text:
type: "string"
description: """
The button text to be displayed. The id will be displayed if not set
"""
required: false
confirm:
description: "Ask the user to confirm the input select"
type: "boolean"
default: false
}
}