Fix mobile_app returning cloud URL when not subscribed (#83257)

fixes undefined
This commit is contained in:
Joris Pelgröm 2022-12-05 03:10:26 +01:00 committed by GitHub
parent 3044e78d43
commit 34fd64addf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -91,6 +91,7 @@ class RegistrationsView(HomeAssistantView):
) )
remote_ui_url = None remote_ui_url = None
if cloud.async_active_subscription(hass):
with suppress(hass.components.cloud.CloudNotAvailable): with suppress(hass.components.cloud.CloudNotAvailable):
remote_ui_url = cloud.async_remote_ui_url(hass) remote_ui_url = cloud.async_remote_ui_url(hass)

View File

@ -693,6 +693,7 @@ async def webhook_get_config(
if CONF_CLOUDHOOK_URL in config_entry.data: if CONF_CLOUDHOOK_URL in config_entry.data:
resp[CONF_CLOUDHOOK_URL] = config_entry.data[CONF_CLOUDHOOK_URL] resp[CONF_CLOUDHOOK_URL] = config_entry.data[CONF_CLOUDHOOK_URL]
if cloud.async_active_subscription(hass):
with suppress(hass.components.cloud.CloudNotAvailable): with suppress(hass.components.cloud.CloudNotAvailable):
resp[CONF_REMOTE_UI_URL] = cloud.async_remote_ui_url(hass) resp[CONF_REMOTE_UI_URL] = cloud.async_remote_ui_url(hass)