Skip to content

Commit

Permalink
Link and expand JSON schema for easier editing of library file (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
deosrc authored Dec 12, 2023
1 parent 67e15e2 commit a7fc903
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom_components/battery_notes/data/library.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "../../../schema.json",
"version": 1,
"devices": [
{
Expand Down
19 changes: 15 additions & 4 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"description": "Library of battery types for devices",
"type": "object",
"properties": {
"$schema": {
"description": "Schema reference",
"type": "string",
"format": "../../../schema.json"
},
"version": {
"description": "Version of the library schema",
"type": "integer"
Expand All @@ -21,23 +26,29 @@
],
"properties": {
"manufacturer": {
"type": "string"
"type": "string",
"description": "The manufacturer of the device as it appears in Home Assistant."
},
"model": {
"type": "string"
"type": "string",
"description": "The model of the device as it appears in Home Assistant."
},
"battery_type": {
"type": "string"
"type": "string",
"description": "The type of battery for the device. Should be the most common naming for general batteries, and the IEC naming for battery cells according to Wikipedia."
},
"battery_quantity": {
"type": "integer"
"type": "integer",
"exclusiveMinimum": 1,
"description": "The number of batteries required by the device. If a device only has one battery this property should be omitted."
}
}
}
}
},
"additionalProperties": false,
"required": [
"$schema",
"version",
"devices"
]
Expand Down

0 comments on commit a7fc903

Please sign in to comment.