diff --git a/minimateplus/protocol.py b/minimateplus/protocol.py index ad5fdff..5857191 100644 --- a/minimateplus/protocol.py +++ b/minimateplus/protocol.py @@ -500,12 +500,8 @@ class MiniMateProtocol: ("D", 0x002A, _DATA_PARAMS), # _DATA_PARAMS built above ] - config = bytearray() - # Track (page_key, chunk_size) pairs to detect when frame D returns the - # same page/size as frame B — observed on BE11529 when the device is - # busy or connection state is fresh. Duplicate chunks inflate the cfg - # and mis-align field offsets, so we drop them. - seen_chunks: set[tuple[int, int]] = set() + config = bytearray() + seen_bytes: set[bytes] = set() # exact-content dedup (not page_key+len) for step_name, step_offset, step_params in _STEPS: log.debug( @@ -526,17 +522,16 @@ class MiniMateProtocol: chunk = data_rsp.data[11:] page = data_rsp.page_key - key = (page, len(chunk)) - if key in seen_chunks: + if chunk in seen_bytes: log.warning( "read_compliance_config: frame %s page=0x%04X data=%d " - "cfg_chunk=%d DUPLICATE — skipping", + "cfg_chunk=%d BYTE-IDENTICAL DUPLICATE — skipping", step_name, page, len(data_rsp.data), len(chunk), ) continue - seen_chunks.add(key) + seen_bytes.add(bytes(chunk)) log.warning( "read_compliance_config: frame %s page=0x%04X data=%d " "cfg_chunk=%d running_total=%d",