From 3effa1aab5a02fd903898ba8ffd30a2f48836565 Mon Sep 17 00:00:00 2001 From: Brian Harrison Date: Fri, 3 Apr 2026 16:47:06 -0400 Subject: [PATCH] feat: add detailed logging for event counting process in MiniMateClient --- minimateplus/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/minimateplus/client.py b/minimateplus/client.py index 0380481..ff1e5f8 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -192,6 +192,11 @@ class MiniMateClient: log.warning("count_events: 1E failed: %s — returning 0", exc) return 0 + log.warning( + "count_events: 1E → key=%s data8=%s trailing=%s", + key4.hex(), data8.hex(), data8[4:8].hex(), + ) + if data8[4:8] == b"\x00\x00\x00\x00": log.info("count_events: 1E returned null sentinel — device is empty") return 0 @@ -201,6 +206,10 @@ class MiniMateClient: count += 1 try: key4, data8 = proto.advance_event() + log.warning( + "count_events: 1F [iter %d] → key=%s data8=%s trailing=%s", + count, key4.hex(), data8.hex(), data8[4:8].hex(), + ) except ProtocolError as exc: log.warning("count_events: 1F failed after %d events: %s", count, exc) break