mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Import webhook in toon (#64544)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
f1e591f2d7
commit
6a6cdef725
@ -6,7 +6,7 @@ import secrets
|
|||||||
|
|
||||||
from toonapi import Status, Toon, ToonError
|
from toonapi import Status, Toon, ToonError
|
||||||
|
|
||||||
from homeassistant.components import cloud
|
from homeassistant.components import cloud, webhook
|
||||||
from homeassistant.components.webhook import (
|
from homeassistant.components.webhook import (
|
||||||
async_register as webhook_register,
|
async_register as webhook_register,
|
||||||
async_unregister as webhook_unregister,
|
async_unregister as webhook_unregister,
|
||||||
@ -69,8 +69,8 @@ class ToonDataUpdateCoordinator(DataUpdateCoordinator[Status]):
|
|||||||
else:
|
else:
|
||||||
webhook_url = self.entry.data[CONF_CLOUDHOOK_URL]
|
webhook_url = self.entry.data[CONF_CLOUDHOOK_URL]
|
||||||
else:
|
else:
|
||||||
webhook_url = self.hass.components.webhook.async_generate_url(
|
webhook_url = webhook.async_generate_url(
|
||||||
self.entry.data[CONF_WEBHOOK_ID]
|
self.hass, self.entry.data[CONF_WEBHOOK_ID]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ensure the webhook is not registered already
|
# Ensure the webhook is not registered already
|
||||||
|
Loading…
x
Reference in New Issue
Block a user