-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathschema.json
64 lines (64 loc) · 2.73 KB
/
schema.json
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
{
"title": "I2C Component Definition",
"description": "An I2C-based WipperSnapper component for use in Adafruit IO",
"type": "object",
"$defs": {
"subcomponent": {
"type": ["string", "object"],
"pattern": "^(unspecified|accelerometer|magnetic-field|orientation|gyroscope|light|pressure|proximity|gravity|acceleration|rotation|humidity|ambient-temp|object-temp|voltage|current|color|raw|pm10-std|pm25-std|pm100-std|pm10-env|pm25-env|pm100-env|co2|gas-resistance|altitude|lux|eco2|unitless-percent|ambient-temp-fahrenheit|object-temp-fahrenheit)$",
"required": [ "displayName", "sensorType" ],
"additionalProperties": false,
"properties": {
"displayName": {
"description": "The human-friendly name of this sensor.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"type": {
"description": "A unique string used to look up this sensor's definition, and its parent component's definition.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"sensorType": {
"description": "One of the supported I2C sensor type strings (found in README).",
"type": "string",
"pattern": "^(unspecified|accelerometer|magnetic-field|orientation|gyroscope|light|pressure|proximity|gravity|acceleration|rotation|humidity|ambient-temp|object-temp|voltage|current|color|raw|pm10-std|pm25-std|pm100-std|pm10-env|pm25-env|pm100-env|co2|gas-resistance|altitude|lux|eco2|unitless-percent|ambient-temp-fahrenheit|object-temp-fahrenheit)$"
},
"defaultPeriod": {
"description": "What period to the form should default to for this sensor.",
"type": "number",
"minimum": 30,
"maximum": 86400
}
}
}
},
"required": [ "displayName", "i2cAddresses", "subcomponents" ],
"additionalProperties": false,
"properties": {
"displayName": {
"description": "The human-friendly name of this component.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"published": {
"description": "If true, this component is supported by the current firmware version and will be displayed to all users. If false, it is hidden behind a developer toggle so that contributors can still work on it against the production site.",
"type": "boolean"
},
"i2cAddresses": {
"description": "List of I2C addresses (as hex string, like \"0x38\") this component can appear on.",
"type": "array",
"items": {
"type": "string"
}
},
"subcomponents": {
"description": "List of sensors on this I2C component.",
"type": "array",
"items": { "$ref": "#/$defs/subcomponent" }
}
}
}