Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft - Test CI - API v2 Protobuf extensions, mainly for I2C although all components valid #235

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions components/i2c/as7262/definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/3779",
"documentationURL": "https://learn.adafruit.com/adafruit-as7262-6-channel-visible-light-sensor",
"displayName": "AS7262",
"published": true,
"i2cAddresses": [ "0x49" ],
"subcomponents": [
{
"displayName": "Violet / Magenta",
"sensorType": "light",
"feedSuffix": "violet"
},
{
"displayName": "Blue",
"sensorType": "light",
"feedSuffix": "blue"
},
{
"displayName": "Green",
"sensorType": "light",
"feedSuffix": "green"
},
{
"displayName": "Yellow",
"sensorType": "light",
"feedSuffix": "yellow"
},
{
"displayName": "Orange",
"sensorType": "light",
"feedSuffix": "orange"
},
{
"displayName": "Red",
"sensorType": "light",
"feedSuffix": "red"
}
]
}
2 changes: 1 addition & 1 deletion components/i2c/ltr303/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"displayName": "Infrared",
"sensorType": "raw"
"sensorType": "light"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion components/i2c/ltr329/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"displayName": "Infrared",
"sensorType": "raw"
"sensorType": "light"
}
]
}
63 changes: 63 additions & 0 deletions components/i2c/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"minLength": 3,
"maxLength": 24
},
"feedSuffix": {
"description": "A unique string used to create the feed name for this sub-component, e.g.'red' suffix and type='light' would give ws-001-light-red.",
"type": "string",
"minLength": 1,
"maxLength": 24
},
"sensorType": {
"description": "One of the supported I2C sensor type strings (found in README).",
"type": "string",
Expand Down Expand Up @@ -81,6 +87,63 @@
"description": "List of sensors on this I2C component.",
"type": "array",
"items": { "$ref": "#/$defs/subcomponent" }
},
"customProperties": {
"description": "A list of custom properties that this component supports.",
"type": "array",
"items": {
"type": "object",
"required": [ "name", "type", "description", "default", "displayed" ],
"properties": {
"name": {
"description": "The name and key of the custom property.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"type": {
"description": "The type of the custom property.",
"type": "string",
"pattern": "^(color|string|number|boolean|range|list)$"
},
"description": {
"description": "A brief description of the custom property.",
"type": "string",
"minLength": 3,
"maxLength": 255
},
"default": {
"description": "The default value of the custom property.",
"type": ["string", "number", "boolean"]
},
"displayed": {
"description": "If true, this custom property will be displayed in the UI.",
"type": "boolean"
},
"displayName": {
"description": "The human-friendly name of this custom property.",
"type": "string",
"minLength": 3,
"maxLength": 150
},
"displayOptions": {
"description": "Options or values for the custom property.",
"type": "object",
"optionalProperties": {
"min": { "type": "number" },
"max": { "type": "number" },
"step": { "type": "number" },
"values": {
"type": "array",
"items": {
"type": "object",
"required": [ "key", "displayText" ]
}
}
}
}
}
}
}
}
}
24 changes: 23 additions & 1 deletion components/i2c/sgp30/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,27 @@
"documentationURL": "https://learn.adafruit.com/adafruit-sgp30-gas-tvoc-eco2-mox-sensor",
"published": true,
"i2cAddresses": [ "0x58" ],
"subcomponents": [ "eco2", "tvoc" ]
"subcomponents": [ "eco2", "tvoc" ],
"customProperties": [
{
"name": "input-temp",
"displayName": "Reference Ambient Temperature (°C)",
"type": "number",
"default": 20,
"description": "The reference ambient temperature in degrees Celsius.",
"displayed": true
},
{
"name": "input-humidity",
"displayName": "Reference Relative Humidity (%)",
"type": "number",
"default": 50,
"description": "The reference relative humidity in percent.",
"displayed": true,
"displayOptions": {
"min": 0,
"max": 100
}
}
]
}
Loading