Ensure Toon webhook ID isn't registered on re-registration (#38376)

This commit is contained in:
Franck Nijhof 2020-07-30 21:37:34 +02:00 committed by GitHub
parent ad0560ef37
commit ecf22198c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,9 @@ class ToonDataUpdateCoordinator(DataUpdateCoordinator[Status]):
self.entry.data[CONF_WEBHOOK_ID]
)
# Ensure the webhook is not registered already
webhook_unregister(self.hass, self.entry.data[CONF_WEBHOOK_ID])
webhook_register(
self.hass,
DOMAIN,