mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Import function instead of relying on hass.component
in watergate (#141945)
This commit is contained in:
parent
a904df5bc2
commit
c5f75bc135
@ -15,6 +15,7 @@ from homeassistant.components.webhook import (
|
|||||||
Response,
|
Response,
|
||||||
async_generate_url,
|
async_generate_url,
|
||||||
async_register,
|
async_register,
|
||||||
|
async_unregister,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_IP_ADDRESS, CONF_WEBHOOK_ID, Platform
|
from homeassistant.const import CONF_IP_ADDRESS, CONF_WEBHOOK_ID, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -75,7 +76,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: WatergateConfigEntry) ->
|
|||||||
async def async_unload_entry(hass: HomeAssistant, entry: WatergateConfigEntry) -> bool:
|
async def async_unload_entry(hass: HomeAssistant, entry: WatergateConfigEntry) -> bool:
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
webhook_id = entry.data[CONF_WEBHOOK_ID]
|
webhook_id = entry.data[CONF_WEBHOOK_ID]
|
||||||
hass.components.webhook.async_unregister(webhook_id)
|
async_unregister(hass, webhook_id)
|
||||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user