Skip to content

Commit

Permalink
Merge pull request #482 from korzonkiee/fix/PolarSleepData-PolarSleep…
Browse files Browse the repository at this point in the history
…AnalysisResult-public-fields

fix: make PolarSleepData properties public
  • Loading branch information
samulimaa authored Aug 30, 2024
2 parents 3eac65e + ef9ab8a commit bae2528
Showing 1 changed file with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation

public class PolarSleepData {

enum SleepWakeState: Int {
public enum SleepWakeState: Int {
case UNKNOWN = 0
case WAKE = -2
case REM = -3
Expand All @@ -22,7 +22,7 @@ public class PolarSleepData {
}
}

enum SleepRating: Int {
public enum SleepRating: Int {
case SLEPT_UNDEFINED = -1
case SLEPT_POORLY = 0
case SLEPT_SOMEWHAT_POORLY = 1
Expand All @@ -39,37 +39,37 @@ public class PolarSleepData {
}
}

public struct PolarSleepAnalysisResult {
let sleepStartTime: Date!
let sleepEndTime: Date!
let lastModified: Date!
let sleepGoalMinutes: UInt32!
let sleepWakePhases: [SleepWakePhase]!
let snoozeTime: [Date]?
let alarmTime: Date?
let sleepStartOffsetSeconds: Int32!
let sleepEndOffsetSeconds: Int32!
let userSleepRating: SleepRating?
let deviceId: String?
let batteryRanOut: Bool?
let sleepCycles: [SleepCycle]!
let sleepResultDate: Date?
let originalSleepRange: OriginalSleepRange?
public struct PolarSleepAnalysisResult {
public let sleepStartTime: Date!
public let sleepEndTime: Date!
public let lastModified: Date!
public let sleepGoalMinutes: UInt32!
public let sleepWakePhases: [SleepWakePhase]!
public let snoozeTime: [Date]?
public let alarmTime: Date?
public let sleepStartOffsetSeconds: Int32!
public let sleepEndOffsetSeconds: Int32!
public let userSleepRating: SleepRating?
public let deviceId: String?
public let batteryRanOut: Bool?
public let sleepCycles: [SleepCycle]!
public let sleepResultDate: Date?
public let originalSleepRange: OriginalSleepRange?
}

struct SleepWakePhase {
var secondsFromSleepStart: UInt32!
var state: SleepWakeState!
public struct SleepWakePhase {
public var secondsFromSleepStart: UInt32!
public var state: SleepWakeState!
}

struct SleepCycle {
let secondsFromSleepStart: UInt32!
let sleepDepthStart: Float!
public struct SleepCycle {
public let secondsFromSleepStart: UInt32!
public let sleepDepthStart: Float!
}

struct OriginalSleepRange {
let startTime: Date?
let endTime: Date?
public struct OriginalSleepRange {
public let startTime: Date?
public let endTime: Date?

}

Expand Down

0 comments on commit bae2528

Please sign in to comment.