diff --git a/README.md b/README.md index a800437..204d1e1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Ko-Fi](https://img.shields.io/static/v1.svg?label=%20&message=Ko-Fi&color=F16061&logo=ko-fi&logoColor=white)](https://www.ko-fi.com/Tasshack) [![PayPal.Me](https://img.shields.io/static/v1.svg?label=%20&message=PayPal.Me&logo=paypal)](https://paypal.me/Tasshackk) -![Dreame Logo](https://raw.githubusercontent.com/Tasshack/dreame-vacuum/dev/docs/media/logo.png "Dreame") +![Logo](https://raw.githubusercontent.com/Tasshack/dreame-vacuum/dev/docs/media/logo.png) # Dreame vacuum integration for Home Assistant diff --git a/custom_components/dreame_vacuum/coordinator.py b/custom_components/dreame_vacuum/coordinator.py index 81120a8..35ce70e 100644 --- a/custom_components/dreame_vacuum/coordinator.py +++ b/custom_components/dreame_vacuum/coordinator.py @@ -115,8 +115,8 @@ def __init__( self.device.listen( self._cleaning_paused_changed, DreameVacuumProperty.CLEANING_PAUSED ) - self.device.listen(self.async_set_updated_data) - self.device.listen_error(self.async_set_update_error) + self.device.listen(self.set_updated_data) + self.device.listen_error(self.set_update_error) super().__init__( hass, @@ -284,7 +284,7 @@ def _create_persistent_notification(self, content, notification_id) -> None: return - persistent_notification.async_create( + persistent_notification.create( self.hass, content, title=self.device.name, @@ -292,7 +292,7 @@ def _create_persistent_notification(self, content, notification_id) -> None: ) def _remove_persistent_notification(self, notification_id) -> None: - persistent_notification.async_dismiss( + persistent_notification.dismiss( self.hass, f"{DOMAIN}_{self.device.mac}_{notification_id}") def _notification_dismiss_listener(self, type, data) -> None: @@ -336,6 +336,12 @@ async def _async_update_data(self) -> DreameVacuumDevice: self.device = None raise UpdateFailed(ex) from ex + def set_update_error(self, ex=None) -> None: + self.hass.loop.call_soon_threadsafe(self.async_set_update_error, ex) + + def set_updated_data(self, device=None) -> None: + self.hass.loop.call_soon_threadsafe(self.async_set_updated_data, device) + @callback def async_set_updated_data(self, device=None) -> None: if self._has_temporary_map != self.device.status.has_temporary_map: diff --git a/custom_components/dreame_vacuum/manifest.json b/custom_components/dreame_vacuum/manifest.json index b59981a..5b99e35 100644 --- a/custom_components/dreame_vacuum/manifest.json +++ b/custom_components/dreame_vacuum/manifest.json @@ -19,5 +19,5 @@ "tzlocal", "paho-mqtt" ], - "version": "v1.0.2" + "version": "v1.0.3" } \ No newline at end of file diff --git a/info.md b/info.md index b6b4abe..1f1bf8d 100644 --- a/info.md +++ b/info.md @@ -6,7 +6,7 @@ [![Ko-Fi](https://img.shields.io/static/v1.svg?label=%20&message=Ko-Fi&color=F16061&logo=ko-fi&logoColor=white)](https://www.ko-fi.com/Tasshack) [![PayPal.Me](https://img.shields.io/static/v1.svg?label=%20&message=PayPal.Me&logo=paypal)](https://paypal.me/Tasshackk) -![Dreame Logo](https://raw.githubusercontent.com/Tasshack/dreame-vacuum/dev/docs/media/logo.png "Dreame") +![Logo](https://raw.githubusercontent.com/Tasshack/dreame-vacuum/dev/docs/media/logo.png) # Dreame vacuum integration for Home Assistant