From 8ed6fcd58ee7cbbdfcff0cf94c2a0bc61963546c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 7 Dec 2022 16:48:34 +0100 Subject: [PATCH] When an account exist without a subscription "provider" will not exist (#83472) --- homeassistant/components/cloud/repairs.py | 2 +- tests/components/cloud/test_repairs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/cloud/repairs.py b/homeassistant/components/cloud/repairs.py index 779c0eb64b0..0d217521c21 100644 --- a/homeassistant/components/cloud/repairs.py +++ b/homeassistant/components/cloud/repairs.py @@ -30,7 +30,7 @@ def async_manage_legacy_subscription_issue( If the provider is "legacy" create an issue, in all other cases remove the issue. """ - if subscription_info["provider"] == "legacy": + if subscription_info.get("provider") == "legacy": ir.async_create_issue( hass=hass, domain=DOMAIN, diff --git a/tests/components/cloud/test_repairs.py b/tests/components/cloud/test_repairs.py index ef96efaa402..052cdde0d0d 100644 --- a/tests/components/cloud/test_repairs.py +++ b/tests/components/cloud/test_repairs.py @@ -70,7 +70,7 @@ async def test_legacy_subscription_delete_issue_if_no_longer_legacy( domain="cloud", issue_id="legacy_subscription" ) - cloud_repairs.async_manage_legacy_subscription_issue(hass, {"provider": None}) + cloud_repairs.async_manage_legacy_subscription_issue(hass, {}) assert not issue_registry.async_get_issue( domain="cloud", issue_id="legacy_subscription" )