client/models/server: wire event_count from SUB 08 event index into connect()
- DeviceInfo.event_count: Optional[int] = None (new field in models.py) - connect() now calls proto.read_event_index() after compliance config and stores the decoded count in device_info.event_count - _serialise_device_info() exposes event_count in /device/info and /device/events JSON responses event_count is decoded from uint32 BE at offset +3 of the 88-byte F7 payload (🔶 inferred — needs live device confirmation against a multi-event device). Any ProtocolError from the index read is caught and logged; event_count stays None rather than failing the whole connect(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,9 @@ class DeviceInfo:
|
||||
# ── From SUB 1A (COMPLIANCE_CONFIG_RESPONSE) ──────────────────────────────
|
||||
compliance_config: Optional["ComplianceConfig"] = None # E5 response, read in connect()
|
||||
|
||||
# ── From SUB 08 (EVENT_INDEX_RESPONSE) ────────────────────────────────────
|
||||
event_count: Optional[int] = None # stored event count from F7 response 🔶
|
||||
|
||||
def __str__(self) -> str:
|
||||
fw = self.firmware_version or f"?.{self.firmware_minor}"
|
||||
mdl = self.model or "MiniMate Plus"
|
||||
|
||||
Reference in New Issue
Block a user