From 43393dafcd325184cc8f38be6f66017b3bbb50f6 Mon Sep 17 00:00:00 2001 From: ngovinh2k2 Date: Thu, 24 Sep 2026 13:19:59 +0700 Subject: [PATCH] refactor: remove latest checkpoint for device --- apps/device/services/entity_properties_service.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/apps/device/services/entity_properties_service.py b/apps/device/services/entity_properties_service.py index e9e607b..2130ffd 100644 --- a/apps/device/services/entity_properties_service.py +++ b/apps/device/services/entity_properties_service.py @@ -43,20 +43,6 @@ def _build_device_properties(self, entities: list[dict]) -> dict | None: if not category or value is None: continue - if category == "location" and isinstance(value, dict): - latest_checkpoint = { - "timestamp": entity.get("time_end"), - "latitude": value.get("latitude"), - "longitude": value.get("longitude"), - "bearing": value.get("bearing"), - } - if ( - latest_checkpoint["latitude"] is not None - and latest_checkpoint["longitude"] is not None - ): - device_properties["latest_checkpoint"] = latest_checkpoint - continue - device_properties[category] = value return device_properties or None