Skip to content

Commit

Permalink
directly import webhook registration methods, don't use them from has…
Browse files Browse the repository at this point in the history
…s.components.webhook, fixes #4
  • Loading branch information
lociii committed Jul 5, 2024
1 parent 1c2c97f commit 28d9807
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.2 (2024-07-05)

- fix deprecated import of webhook component

## 1.0.1 (2023-01-31)

- Updated instructions
Expand Down
14 changes: 11 additions & 3 deletions custom_components/overwolfstatus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from aiohttp import web

from homeassistant.components.webhook import async_register, async_unregister
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import HomeAssistant
Expand All @@ -24,15 +25,22 @@ async def handle_webhook(

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Configure based on config entry."""
hass.components.webhook.async_register(
DOMAIN, TITLE, entry.data[CONF_WEBHOOK_ID], handle_webhook
async_register(
hass,
DOMAIN,
TITLE,
entry.data[CONF_WEBHOOK_ID],
handle_webhook,
)
return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
async_unregister(
hass,
entry.data[CONF_WEBHOOK_ID],
)
return True


Expand Down
2 changes: 1 addition & 1 deletion custom_components/overwolfstatus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"iot_class": "cloud_push",
"issue_tracker": "https://github.com/lociii/homeassistant-overwolf-status/issues",
"requirements": [],
"version": "1.0.1"
"version": "1.0.2"
}

0 comments on commit 28d9807

Please sign in to comment.