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

This commit is contained in:
Franck Nijhof authored and Paulus Schoutsen committed 2020-08-01 01:59:46 +00:00
1 parent 293655f988
commit 47a729495d
1 file changed
+3
@@ -71,6 +71,9 @@ class ToonDataUpdateCoordinator(DataUpdateCoordinator):
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,