More efficient use of complication user info transfers#832
More efficient use of complication user info transfers#832mpangburn wants to merge 2 commits intoLoopKit:devfrom
Conversation
|
A few notes:
|
Without a wake time, we don't have the full picture of the user's waking hours. To condense the interval over which to distribute transfers, we need both parameters here.
I've refactored DailyScheduleTime to use DateComponents, though I've kept it as a separate struct to improve compile-time safety since only the hour and minute components are pertinent here.
I can't find any such type, though I've made sure to remove any usage of TimeInterval in calendar computations. |
|
It seems like complication pushes might not decrement the number of future updates when on the charger? Have you seen that? |
|
If we can can figure the number of hours from the current date to bedtime, and try to spread the remaining complication pushes over that time, then we don't need a wake time. |
|
I've seen the same, yes—complication updates aren't used up when the Watch is charging. We might be able to get away with only a bedtime if everyone took off their Watch when going to bed, but not everyone does. The motivation for leaving it on isn't super obvious to me (third-party sleep-tracking apps, maybe?), but I know a number of people who only take off their Watch to charge while getting ready in the morning. |
|
Closing for now. We can do this better using HK data. |
Relevant discussion in #816.
Summary of changes:
WatchComplicationUpdateManager, whose sole purpose is to answer the question "should a complication user info transfer be used now?"WatchSettings, which includes user preferences for Watch app and complication behavior. These settings are stored inWatchDataManager.DailyScheduleInterval, which describes a continuous period of time in a daily schedule.Gardening:
WatchContextis given anamefield to avoid the "nil name field means context" dance we've been doing.Points for discussion:
DatePickerTableViewCellis ripped directly from LoopKit.DateAndDurationTableViewCellis also ripped from LoopKit, with one small to specialize behavior for the picker configuration inupdateDateLabel(). I've copied them over to contain this PR to Loop, but exposing these classes publicly in LoopKit is probably a cleaner solution.