From 6a6cdef725b67325b6aff84325cd549f26f14085 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:04:47 +0100 Subject: [PATCH] Import webhook in toon (#64544) Co-authored-by: epenet --- homeassistant/components/toon/coordinator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/toon/coordinator.py b/homeassistant/components/toon/coordinator.py index 712edd9dfda..f013e4bcb75 100644 --- a/homeassistant/components/toon/coordinator.py +++ b/homeassistant/components/toon/coordinator.py @@ -6,7 +6,7 @@ import secrets from toonapi import Status, Toon, ToonError -from homeassistant.components import cloud +from homeassistant.components import cloud, webhook from homeassistant.components.webhook import ( async_register as webhook_register, async_unregister as webhook_unregister, @@ -69,8 +69,8 @@ class ToonDataUpdateCoordinator(DataUpdateCoordinator[Status]): else: webhook_url = self.entry.data[CONF_CLOUDHOOK_URL] else: - webhook_url = self.hass.components.webhook.async_generate_url( - self.entry.data[CONF_WEBHOOK_ID] + webhook_url = webhook.async_generate_url( + self.hass, self.entry.data[CONF_WEBHOOK_ID] ) # Ensure the webhook is not registered already