Parcourir la source

Align TT creation with rest of Trio code

Jonas Björkert il y a 1 an
Parent
commit
2a1c2350d7

+ 6 - 4
FreeAPS/Sources/Modules/RemoteControl/TrioRemoteControl.swift

@@ -212,14 +212,16 @@ class TrioRemoteControl: Injectable {
         }
 
         let durationInMinutes = Int(durationValue)
+        let pushMessageDate = Date(timeIntervalSince1970: pushMessage.timestamp)
+
         let tempTarget = TempTarget(
-            name: "Remote Control",
-            createdAt: Date(),
+            name: TempTarget.custom,
+            createdAt: pushMessageDate,
             targetTop: Decimal(targetValue),
             targetBottom: Decimal(targetValue),
             duration: Decimal(durationInMinutes),
-            enteredBy: pushMessage.user,
-            reason: "Remote temp target command"
+            enteredBy: TempTarget.manual,
+            reason: TempTarget.custom
         )
 
         tempTargetsStorage.storeTempTargets([tempTarget])