Last active
June 22, 2020 23:40
-
-
Save alryaz/80b9dc243f6f8effb5e74eef05e42f07 to your computer and use it in GitHub Desktop.
Home Assistant Component Manifest Schema (WIP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema", | |
"$id": "http://example.com/example.json", | |
"type": "object", | |
"title": "The root schema", | |
"description": "The root schema comprises the entire JSON document.", | |
"default": {}, | |
"examples": [ | |
{ | |
"domain": "hue", | |
"name": "Philips Hue", | |
"documentation": "https://www.home-assistant.io/components/hue", | |
"issue_tracker": "https://github.com/balloob/hue/issues", | |
"dependencies": [ | |
"mqtt" | |
], | |
"after_dependencies": [ | |
"http" | |
], | |
"codeowners": [ | |
"@balloob" | |
], | |
"requirements": [ | |
"aiohue==1.9.1" | |
], | |
"quality_scale": "platinum" | |
} | |
], | |
"required": [ | |
"domain", | |
"name", | |
"documentation", | |
"dependencies", | |
"codeowners", | |
"requirements" | |
], | |
"additionalProperties": true, | |
"properties": { | |
"domain": { | |
"$id": "#/properties/domain", | |
"type": "string", | |
"title": "Domain (ID) of the component", | |
"description": "Should be equal to the directory the component uses.", | |
"default": "", | |
"examples": [ | |
"hue" | |
] | |
}, | |
"name": { | |
"$id": "#/properties/name", | |
"type": "string", | |
"title": "Friendly name", | |
"description": "Used to describe component in various places.", | |
"default": "", | |
"examples": [ | |
"Philips Hue" | |
] | |
}, | |
"documentation": { | |
"$id": "#/properties/documentation", | |
"type": "string", | |
"title": "Documentation URL", | |
"description": "Link to online documentation for the component.", | |
"default": "", | |
"examples": [ | |
"https://www.home-assistant.io/components/hue" | |
] | |
}, | |
"issue_tracker": { | |
"$id": "#/properties/issue_tracker", | |
"type": "string", | |
"title": "Issue tracker URL", | |
"description": "Link to online issue tracker for the component.", | |
"default": "", | |
"examples": [ | |
"https://github.com/balloob/hue/issues" | |
] | |
}, | |
"dependencies": { | |
"$id": "#/properties/dependencies", | |
"type": "array", | |
"title": "Dependencies before setup", | |
"description": "List of components (domains) that are required to be loaded before component is considered ready for setup.", | |
"default": [], | |
"examples": [ | |
[ | |
"mqtt" | |
] | |
], | |
"additionalItems": true, | |
"items": { | |
"anyOf": [ | |
{ | |
"$id": "#/properties/dependencies/items/anyOf/0", | |
"type": "string", | |
"title": "Component (domain)", | |
"description": "Component under this domain will be loaded before manifest's component setup.", | |
"default": "", | |
"examples": [ | |
"mqtt" | |
] | |
} | |
], | |
"$id": "#/properties/dependencies/items" | |
} | |
}, | |
"after_dependencies": { | |
"$id": "#/properties/after_dependencies", | |
"type": "array", | |
"title": "Dependencies after setup", | |
"description": "List of components (domains) that are required to be loaded after component setup is complete.", | |
"default": [], | |
"examples": [ | |
[ | |
"http" | |
] | |
], | |
"additionalItems": true, | |
"items": { | |
"anyOf": [ | |
{ | |
"$id": "#/properties/after_dependencies/items/anyOf/0", | |
"type": "string", | |
"title": "Component (domain)", | |
"description": "Component under this domain will be loaded after manifest's component setup.", | |
"default": "", | |
"examples": [ | |
"http" | |
] | |
} | |
], | |
"$id": "#/properties/after_dependencies/items" | |
} | |
}, | |
"codeowners": { | |
"$id": "#/properties/codeowners", | |
"type": "array", | |
"title": "Code owners", | |
"description": "List of usernames (GitHub or Home Assistant community) that contributed majorly to the development of the component.", | |
"default": [], | |
"examples": [ | |
[ | |
"@balloob" | |
] | |
], | |
"additionalItems": true, | |
"items": { | |
"anyOf": [ | |
{ | |
"$id": "#/properties/codeowners/items/anyOf/0", | |
"type": "string", | |
"title": "@Username", | |
"description": "Username of a code contributor (prefixed with @).", | |
"default": "", | |
"examples": [ | |
"@balloob" | |
] | |
} | |
], | |
"$id": "#/properties/codeowners/items" | |
} | |
}, | |
"requirements": { | |
"$id": "#/properties/requirements", | |
"type": "array", | |
"title": "Required python packages (wheels)", | |
"description": "These packages will be installed using internal `pip` (unless already installed) before the component begins loading stage.", | |
"default": [], | |
"examples": [ | |
[ | |
"aiohue==1.9.1" | |
] | |
], | |
"additionalItems": true, | |
"items": { | |
"anyOf": [ | |
{ | |
"$id": "#/properties/requirements/items/anyOf/0", | |
"type": "string", | |
"title": "Python package + version", | |
"description": "Python package and version to install.", | |
"default": "", | |
"examples": [ | |
"aiohue==1.9.1" | |
] | |
} | |
], | |
"$id": "#/properties/requirements/items" | |
} | |
}, | |
"quality_scale": { | |
"$id": "#/properties/quality_scale", | |
"type": "string", | |
"title": "Quality scale of the component", | |
"description": "List of quality scales to display on Home Assistant documentation page (does not apply to custom components).", | |
"default": "", | |
"examples": [ | |
"platinum" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment