mirror of
https://github.com/home-assistant/core.git
synced 2025-12-23 12:29:55 +00:00
Better cloud check (#21875)
This commit is contained in:
@@ -46,11 +46,9 @@ class RegistrationsView(HomeAssistantView):
|
||||
|
||||
webhook_id = generate_secret()
|
||||
|
||||
if "cloud" in hass.config.components:
|
||||
cloudhook = await async_create_cloudhook(hass, webhook_id)
|
||||
|
||||
if cloudhook is not None:
|
||||
data[CONF_CLOUDHOOK_URL] = cloudhook[CONF_CLOUDHOOK_URL]
|
||||
if hass.components.cloud.async_active_subscription():
|
||||
data[CONF_CLOUDHOOK_URL] = \
|
||||
await async_create_cloudhook(hass, webhook_id)
|
||||
|
||||
data[CONF_WEBHOOK_ID] = webhook_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user