From a1fa495bb64e67be85a791aa21a969558dde9580 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Wed, 16 Feb 2022 18:49:40 +0000 Subject: [PATCH] Disable instad of hard block integrations with version issues --- homeassistant/loader.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/loader.py b/homeassistant/loader.py index c02fa18eefb..c703c733a99 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -350,7 +350,10 @@ class Integration: "See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details", integration.domain, ) - return None + integration.disable( + "Does not have a version defined in the manifest file" + ) + return integration try: AwesomeVersion( integration.version, @@ -370,7 +373,9 @@ class Integration: integration.domain, integration.version, ) - return None + integration.disable( + f"Does not have a valid version ({integration.version})" + ) return integration return None @@ -543,6 +548,10 @@ class Integration: return self._all_dependencies_resolved + def disable(self, reason: str) -> None: + """Disable the integration.""" + self.manifest["disabled"] = reason + def get_component(self) -> ModuleType: """Return the component.""" cache: dict[str, ModuleType] = self.hass.data.setdefault(DATA_COMPONENTS, {})