From e18426051bcf1a9f73e36e1fb86694c38fcc44e7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 7 Jan 2020 17:21:56 +0100 Subject: [PATCH] Add Integration Quality Scale to manifest (#30547) --- homeassistant/loader.py | 5 +++++ script/hassfest/manifest.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/homeassistant/loader.py b/homeassistant/loader.py index a14a5209840..7a15410f96a 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -239,6 +239,11 @@ class Integration: """Return documentation.""" return cast(str, self.manifest.get("documentation")) + @property + def quality_scale(self) -> Optional[str]: + """Return Integration Quality Scale.""" + return cast(str, self.manifest.get("quality_scale")) + @property def is_built_in(self) -> bool: """Test if package is a built-in integration.""" diff --git a/script/hassfest/manifest.py b/script/hassfest/manifest.py index acc5e9af832..e6bd6551786 100644 --- a/script/hassfest/manifest.py +++ b/script/hassfest/manifest.py @@ -6,6 +6,13 @@ from voluptuous.humanize import humanize_error from .model import Integration +SUPPORTED_QUALITY_SCALES = [ + "gold", + "internal", + "platinum", + "silver", +] + MANIFEST_SCHEMA = vol.Schema( { vol.Required("domain"): str, @@ -17,6 +24,7 @@ MANIFEST_SCHEMA = vol.Schema( ), vol.Optional("homekit"): vol.Schema({vol.Optional("models"): [str]}), vol.Required("documentation"): str, + vol.Optional("quality_scale"): vol.In(SUPPORTED_QUALITY_SCALES), vol.Required("requirements"): [str], vol.Required("dependencies"): [str], vol.Optional("after_dependencies"): [str],