Import webhook in toon ()

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/64558/head
epenet 2022-01-20 12:04:47 +01:00 committed by GitHub
parent f1e591f2d7
commit 6a6cdef725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
homeassistant/components/toon

View File

@ -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