             let name = dict[JSONKey.name] as? String else {
                 return nil
         }
-
+        
         let serverTime = dict[JSONKey.serverTime] as? String ?? AppConfiguration.serverTimeDateFormatter.string(from: Date())
-
+        
         let boluscalcEnabled = dict[JSONKey.boluscalcEnabled] as? Bool ?? false
         
         var settings: Settings?

        let device = Device(rawValue: deviceString) ?? .unknown
        let direction = Direction(rawValue: directionString) ?? .none
        let noise = Noise(rawValue: noiseInt) ?? .unknown

        return SensorGlucoseValue(direction: direction, device: device, rssi: rssi, unfiltered: unfiltered, filtered: filtered, mgdl: mgdl, noise: noise, milliseconds: mill)
    }
}

        
        var mills: Mills?
        if let created = json[JSONKey.created_at] as? String {
            if #available(iOSApplicationExtension 10.0, watchOSApplicationExtension 3.0, *) {
                mills = ISO8601DateFormatter().date(from: created)?.timeIntervalSince1970.millisecond
            } else {
                mills = AppConfiguration.serverTimeDateFormatter.date(from: created)?.timeIntervalSince1970.millisecond
            }
        } else if let intMills = json[JSONKey.mills] as? Int {
            mills = Mills(intMills)
        } else {
            return nil
        }

        return DeviceStatus(uploaderBattery: uploaderBattery, milliseconds: mills ?? Date.distantPast.timeIntervalSince1970.millisecond)
    }
}

