Add timestamps of locations providers #18

Merged
localhorst merged 9 commits from feat/timestamps into main 2025-02-14 21:22:58 +01:00
2 changed files with 13 additions and 5 deletions
Showing only changes of commit 93f0c71a6c - Show all commits
+6
View File
@@ -59,6 +59,11 @@ router.post(
? new Date(longitudeData.timestamp)
: undefined,
};
const wifiTimestamp = (() => {
const messages = message.uplink_message.decoded_payload?.messages?.[0];
const wifiScan = messages?.find((e: { type: string }) => e.type === "Wi-Fi Scan");
return wifiScan?.timestamp ? new Date(wifiScan.timestamp) : undefined;
})();
const wifiScans =
message.uplink_message.decoded_payload?.messages[0]
@@ -67,6 +72,7 @@ router.post(
lp_ttn_end_device_uplinks_id,
mac: w.mac,
rssi: w.rssi,
scanned_at_timestamp: wifiTimestamp,
})) ?? [];
const ttnGatewayReceptions = message.uplink_message.rx_metadata.map(
+2
View File
@@ -5,12 +5,14 @@ interface CreateWifiScanParams {
lp_ttn_end_device_uplinks_id: string;
mac: string;
rssi: number;
scanned_at_timestamp?: Date;
}
interface UpdateWifiScanParams {
wifi_scan_id: string;
mac?: string;
rssi?: number;
scanned_at_timestamp?: Date;
}
@injectable()