diff --git a/minimateplus/client.py b/minimateplus/client.py index bcae5de..a6e3d22 100644 --- a/minimateplus/client.py +++ b/minimateplus/client.py @@ -475,6 +475,12 @@ def _decode_event_count(data: bytes) -> int: log.warning("event index payload too short (%d bytes), assuming 0 events", len(data)) return 0 + # Log the raw bytes so we can verify this decode against known event counts + log.warning( + "event_index raw (first 16 bytes): %s", + " ".join(f"{b:02x}" for b in data[:16]), + ) + # Try the uint32 at +3 first count = struct.unpack_from(">I", data, 3)[0] @@ -485,6 +491,7 @@ def _decode_event_count(data: bytes) -> int: ) return 0 + log.warning("event_index decoded count=%d (uint32 BE at offset +3)", count) return count