From 1cbf0c019526e36978d05400b4bc25a00129db04 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:52:47 -0800 Subject: [PATCH 1/2] Ignore attributes packets while running --- custom_components/tekmar_482/hub.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/custom_components/tekmar_482/hub.py b/custom_components/tekmar_482/hub.py index c1b8f6d..0c92a27 100644 --- a/custom_components/tekmar_482/hub.py +++ b/custom_components/tekmar_482/hub.py @@ -505,13 +505,11 @@ async def run(self) -> None: await self._hass.config_entries.async_reload(self._entry_id) elif tha_method in ["DeviceAttributes"]: - _LOGGER.error( - ( - f"Device attributes for {b['address']} changed. " - "Reloading integration..." - ) + _LOGGER.debug( + f"Ignoring attributes packet from {b['address']} while" + f"running: got {int(b['attributes'])} setup with" + f"{self._tha_inventory[b['address']]['attributes'].attrs}" ) - await self._hass.config_entries.async_reload(self._entry_id) elif tha_method in ["NullMethod"]: pass From 1cfbf2bcb0a7d138e5f74359911fd5f1b647ce8b Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:13:43 -0800 Subject: [PATCH 2/2] Clean up log message formatting --- custom_components/tekmar_482/hub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/tekmar_482/hub.py b/custom_components/tekmar_482/hub.py index 468bbdb..9b47ed0 100644 --- a/custom_components/tekmar_482/hub.py +++ b/custom_components/tekmar_482/hub.py @@ -506,8 +506,8 @@ async def run(self) -> None: elif tha_method in ["DeviceAttributes"]: _LOGGER.debug( - f"Ignoring attributes packet from {b['address']} while" - f"running: got {int(b['attributes'])} setup with" + f"Ignoring attributes from {b['address']} in run: " + f"received {int(b['attributes'])} setup with " f"{self._tha_inventory[b['address']]['attributes'].attrs}" )