This commit is contained in:
admin committed 2026-09-13 17:29:22 +07:00
1 parent 4b5e95500f
commit 290ee2e718
2 files changed
+2 -2

No files matched your search

+2 -2
View File
@@ -331,7 +331,7 @@ class TargetStore:
"server_time": round(now, 2), "server_time": round(now, 2),
} }
def update_from_frame(self, frame: dict): async def update_from_frame(self, frame: dict):
self.node_id = frame.get("node_id", self.node_id) self.node_id = frame.get("node_id", self.node_id)
self.sequence = frame.get("sequence", 0) self.sequence = frame.get("sequence", 0)
self.timestamp_ms = frame.get("timestamp", 0) self.timestamp_ms = frame.get("timestamp", 0)
@@ -479,7 +479,7 @@ async def esp32_ws_forever(esp32_host: str):
log.warning(f"Lỗi parse JSON từ ESP32: {message[:80]}...") log.warning(f"Lỗi parse JSON từ ESP32: {message[:80]}...")
continue continue
STATE.update_from_frame(frame) await STATE.update_from_frame(frame)
_update_zone_occupancy_from_targets(STATE) _update_zone_occupancy_from_targets(STATE)
# Always push the latest state # Always push the latest state
await broadcast_to_browsers() await broadcast_to_browsers()