Package fitbit: Merge the "Data" and "ShortData" sleep stages.
authorFlorian Forster <ff@octo.it>
Thu, 1 Feb 2018 18:49:58 +0000 (19:49 +0100)
committerFlorian Forster <ff@octo.it>
Thu, 1 Feb 2018 18:49:58 +0000 (19:49 +0100)
fitbit/sleep.go

index d0a42cf..d7da138 100644 (file)
@@ -61,7 +61,7 @@ func parseSleep(ctx context.Context, data []byte, loc *time.Location) (*Sleep, e
 
        rawStages := jsonSleep.Levels.Data
        if len(jsonSleep.Levels.ShortData) != 0 {
-               rawStages = jsonSleep.Levels.ShortData
+               rawStages = append(rawStages, jsonSleep.Levels.ShortData...)
        }
 
        var ret Sleep