fix #198 Watch agenda option leads to higher battery consumption with FSL2Direct

In WatchManager the variable timeStampLastProcessedReading was not set. This variable is needed to check if a new event needs to be created in the calendar or not. Two readings must be at least 4.75 minutes away from each other
This commit is contained in:
Johan Degraeve 2021-03-17 11:19:30 +01:00
parent c7b92abe82
commit b0702068e3
1 changed files with 6 additions and 0 deletions

View File

@ -115,9 +115,15 @@ class WatchManager: NSObject {
event.calendar = calendar
do{
try eventStore.save(event, span: .thisEvent)
timeStampLastProcessedReading = lastReading[0].timeStamp
} catch let error {
trace("in createCalendarEvent, error while saving : %{public}@", log: log, category: ConstantsLog.categoryWatchManager, type: .error, error.localizedDescription)
}
}