From 75ce04e373c44e27c397fbef396b4879a21b7501 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sun, 22 Mar 2026 10:06:49 -0700 Subject: [PATCH 1/2] Add debug level logs for setup and run packets --- custom_components/tekmar_482/hub.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/custom_components/tekmar_482/hub.py b/custom_components/tekmar_482/hub.py index da2d26b..428b95d 100644 --- a/custom_components/tekmar_482/hub.py +++ b/custom_components/tekmar_482/hub.py @@ -132,7 +132,9 @@ async def async_init_tha(self) -> None: while self._inSetup is True: if len(self._tx_queue) != 0: try: - await self._sock.write(self._tx_queue.pop(0)) + writePacket = self._tx_queue.pop(0) + _LOGGER.debug(f"Setup {writePacket}") + await self._sock.write(writePacket) await asyncio.sleep(0.1) # writing too fast causes errors except Exception as e: _LOGGER.error(f"Write error: {e}") @@ -150,6 +152,8 @@ async def async_init_tha(self) -> None: h = p.header b = p.body tha_method = name_from_methodID[h["methodID"]] + + _LOGGER.debug(f"Setup {p}") if tha_method in ["FirmwareRevision"]: self._tha_fw_ver = b["revision"] @@ -339,7 +343,9 @@ async def run(self) -> None: ) if len(self._tx_queue) != 0: - await self._sock.write(self._tx_queue.pop(0)) + writePacket = self._tx_queue.pop(0) + _LOGGER.debug(f"Run {writePacket}") + await self._sock.write(writePacket) await asyncio.sleep(0.1) readCycle += 1 @@ -362,6 +368,8 @@ async def run(self) -> None: b = p.body tha_method = name_from_methodID[h["methodID"]] + _LOGGER.debug(f"Run {p}") + if b["address"] in self.tha_ignore_addr: _LOGGER.debug(f"Ignored {p} from address {b['address']}") continue From 4ca2326cf04087b10107eb9fb12bfe37caa0027d Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sun, 22 Mar 2026 10:09:46 -0700 Subject: [PATCH 2/2] Format with ruff --- custom_components/tekmar_482/hub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/tekmar_482/hub.py b/custom_components/tekmar_482/hub.py index 428b95d..b2bac91 100644 --- a/custom_components/tekmar_482/hub.py +++ b/custom_components/tekmar_482/hub.py @@ -152,7 +152,7 @@ async def async_init_tha(self) -> None: h = p.header b = p.body tha_method = name_from_methodID[h["methodID"]] - + _LOGGER.debug(f"Setup {p}") if tha_method in ["FirmwareRevision"]: