-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from ps2/ns-loop-plugin
Ns loop plugin
- Loading branch information
Showing
8 changed files
with
125 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
NightscoutUploadKit/DeviceStatus/RecommendedTempBasal.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// LoopSuggested.swift | ||
// RileyLink | ||
// | ||
// Created by Pete Schwamb on 7/28/16. | ||
// Copyright © 2016 Pete Schwamb. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct RecommendedTempBasal { | ||
let timestamp: NSDate | ||
let rate: Double | ||
let duration: NSTimeInterval | ||
|
||
public init(timestamp: NSDate, rate: Double, duration: NSTimeInterval) { | ||
self.timestamp = timestamp | ||
self.rate = rate | ||
self.duration = duration | ||
} | ||
|
||
public var dictionaryRepresentation: [String: AnyObject] { | ||
|
||
var rval = [String: AnyObject]() | ||
|
||
rval["timestamp"] = TimeFormat.timestampStrFromDate(timestamp) | ||
rval["rate"] = rate | ||
rval["duration"] = duration / 60.0 | ||
return rval | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// RileyLinkStatus.swift | ||
// RileyLink | ||
// | ||
// Created by Pete Schwamb on 8/12/16. | ||
// Copyright © 2016 Pete Schwamb. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct RileyLinkStatus { | ||
|
||
public enum State: String { | ||
case Connected = "connected" | ||
case Connecting = "connecting" | ||
case Disconnected = "disconnected" | ||
} | ||
|
||
let name: String | ||
let state: State | ||
let lastIdle: NSDate? | ||
let version: String? | ||
let rssi: Double? | ||
|
||
public var dictionaryRepresentation: [String: AnyObject] { | ||
var rval = [String: AnyObject]() | ||
|
||
rval["name"] = name | ||
rval["state"] = state.rawValue | ||
|
||
if let lastIdle = lastIdle { | ||
rval["lastIdle"] = TimeFormat.timestampStrFromDate(lastIdle) | ||
} | ||
|
||
if let version = version { | ||
rval["version"] = version | ||
} | ||
|
||
if let rssi = rssi { | ||
rval["rssi"] = rssi | ||
} | ||
|
||
return rval | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters