diff --git a/supervisor/resolution/checks/core_security.py b/supervisor/resolution/checks/core_security.py index f4a8758a1..f821110ef 100644 --- a/supervisor/resolution/checks/core_security.py +++ b/supervisor/resolution/checks/core_security.py @@ -13,7 +13,7 @@ from .base import CheckBase class SecurityReference(str, Enum): """Version references.""" - CUSTOM_COMPONENTS_BELOW_2021_1_3 = "custom_components_below_2021_1_3" + CUSTOM_COMPONENTS_BELOW_2021_1_5 = "custom_components_below_2021_1_5" class CheckCoreSecurity(CheckBase): @@ -22,14 +22,14 @@ class CheckCoreSecurity(CheckBase): async def run_check(self) -> None: """Run check if not affected by issue.""" try: - if self.sys_homeassistant.version < AwesomeVersion("2021.1.3"): + if self.sys_homeassistant.version < AwesomeVersion("2021.1.5"): if Path( self.sys_config.path_homeassistant, "custom_components" ).exists(): self.sys_resolution.create_issue( IssueType.SECURITY, ContextType.CORE, - reference=SecurityReference.CUSTOM_COMPONENTS_BELOW_2021_1_3, + reference=SecurityReference.CUSTOM_COMPONENTS_BELOW_2021_1_5, suggestions=[SuggestionType.EXECUTE_UPDATE], ) except AwesomeVersionException: @@ -38,7 +38,7 @@ class CheckCoreSecurity(CheckBase): async def approve_check(self) -> bool: """Approve check if it is affected by issue.""" try: - if self.sys_homeassistant.version >= AwesomeVersion("2021.1.3"): + if self.sys_homeassistant.version >= AwesomeVersion("2021.1.5"): return False except AwesomeVersionException: return True diff --git a/supervisor/resolution/notify.py b/supervisor/resolution/notify.py index d1ce92796..ce4d42cf5 100644 --- a/supervisor/resolution/notify.py +++ b/supervisor/resolution/notify.py @@ -43,13 +43,13 @@ class ResolutionNotify(CoreSysAttributes): if issue.type == IssueType.SECURITY and issue.context == ContextType.CORE: if ( issue.reference - == SecurityReference.CUSTOM_COMPONENTS_BELOW_2021_1_3 + == SecurityReference.CUSTOM_COMPONENTS_BELOW_2021_1_5 ): messages.append( { "title": "Security notification", - "message": "The Supervisor detected that this version of Home Assistant could be insecure in combination with custom integrations. [Update as soon as possible.](/hassio/dashboard)\n\nFor more information see the [Security bulletin](https://www.home-assistant.io/blog/2021/01/14/security-bulletin/).", - "notification_id": "supervisor_update_home_assistant_2021_1_3", + "message": "The Supervisor detected that this version of Home Assistant could be insecure in combination with custom integrations. [Update as soon as possible.](/hassio/dashboard)\n\nFor more information see the [Security alert](https://www.home-assistant.io/latest-security-alert).", + "notification_id": "supervisor_update_home_assistant_2021_1_5", } ) diff --git a/tests/resolution/check/test_check_core_security.py b/tests/resolution/check/test_check_core_security.py index 257875708..ab96a7854 100644 --- a/tests/resolution/check/test_check_core_security.py +++ b/tests/resolution/check/test_check_core_security.py @@ -31,6 +31,10 @@ async def test_check(coresys: CoreSys, tmp_path): await core_security.run_check() assert len(coresys.resolution.issues) == 0 + coresys.homeassistant._data["version"] = AwesomeVersion("2021.1.5") + await core_security.run_check() + assert len(coresys.resolution.issues) == 0 + coresys.homeassistant._data["version"] = AwesomeVersion("2021.1.2") await core_security.run_check() assert len(coresys.resolution.issues) == 0