diff --git a/CHANGELOG.md b/CHANGELOG.md index 6964c8d..5356a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.1.7 + +- Fix async dispatcher send + ## 2.1.6 - Fix update interface state [#145](https://github.com/elad-bar/ha-edgeos/issues/145) diff --git a/custom_components/edgeos/managers/rest_api.py b/custom_components/edgeos/managers/rest_api.py index 378d95e..1df5501 100644 --- a/custom_components/edgeos/managers/rest_api.py +++ b/custom_components/edgeos/managers/rest_api.py @@ -12,7 +12,7 @@ from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_create_clientsession -from homeassistant.helpers.dispatcher import async_dispatcher_send +from homeassistant.helpers.dispatcher import dispatcher_send from ..common.connectivity_status import ConnectivityStatus from ..common.consts import ( @@ -400,7 +400,7 @@ def _async_dispatcher_send(self, signal: str, *args: Any) -> None: self._local_async_dispatcher_send(signal, None, *args) else: - async_dispatcher_send(self._hass, signal, self._entry_id, *args) + dispatcher_send(self._hass, signal, self._entry_id, *args) async def async_send_heartbeat(self, max_age=HEARTBEAT_MAX_AGE): ts = None diff --git a/custom_components/edgeos/managers/websockets.py b/custom_components/edgeos/managers/websockets.py index bd5b24b..04a2f5b 100644 --- a/custom_components/edgeos/managers/websockets.py +++ b/custom_components/edgeos/managers/websockets.py @@ -14,7 +14,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_create_clientsession -from homeassistant.helpers.dispatcher import async_dispatcher_send +from homeassistant.helpers.dispatcher import dispatcher_send from ..common.connectivity_status import ConnectivityStatus from ..common.consts import ( @@ -395,15 +395,15 @@ def _set_status(self, status: ConnectivityStatus): status, ) - def set_local_async_dispatcher_send(self, dispatcher_send): - self._local_async_dispatcher_send = dispatcher_send + def set_local_async_dispatcher_send(self, callback): + self._local_async_dispatcher_send = callback def _async_dispatcher_send(self, signal: str, *args: Any) -> None: if self._hass is None: self._local_async_dispatcher_send(signal, self._entry_id, *args) else: - async_dispatcher_send(self._hass, signal, self._entry_id, *args) + dispatcher_send(self._hass, signal, self._entry_id, *args) def _increase_counter(self, key): counter = self.data.get(key, 0) diff --git a/custom_components/edgeos/manifest.json b/custom_components/edgeos/manifest.json index 0c78b63..a346744 100644 --- a/custom_components/edgeos/manifest.json +++ b/custom_components/edgeos/manifest.json @@ -8,5 +8,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/elad-bar/ha-edgeos/issues", "requirements": ["aiohttp"], - "version": "2.1.6" + "version": "2.1.7" }