From f34042b3c208d05c684dfd0cae300f71e11de283 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sun, 30 Nov 2025 14:09:10 +0100 Subject: [PATCH] feat: moved from telemetry id to remote id for Remote module --- Kit/plugins/Remote.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Kit/plugins/Remote.swift b/Kit/plugins/Remote.swift index 6767d6e2..47cbf217 100644 --- a/Kit/plugins/Remote.swift +++ b/Kit/plugins/Remote.swift @@ -93,7 +93,16 @@ public class Remote { public init() { self.log = NextLog.shared.copy(category: "Remote") - self.id = UUID(uuidString: Store.shared.string(key: "telemetry_id", defaultValue: UUID().uuidString)) ?? UUID() + + var id = UUID(uuidString: Store.shared.string(key: "remote_id", defaultValue: UUID().uuidString)) ?? UUID() + if Store.shared.exist(key: "telemetry_id") { + id = UUID(uuidString: Store.shared.string(key: "telemetry_id", defaultValue: UUID().uuidString)) ?? UUID() + Store.shared.remove("telemetry_id") + } + if !Store.shared.exist(key: "remote_id") { + Store.shared.set(key: "remote_id", value: id.uuidString) + } + self.id = id self.mqtt.commandCallback = { [weak self] cmd, payload in self?.command(cmd: cmd, payload: payload)