Skip to content

Commit

Permalink
Changed a few UTC references for detecting the top of an hour to loca…
Browse files Browse the repository at this point in the history
…l (thanks, Australia)
  • Loading branch information
voloved committed Oct 26, 2024
1 parent 7a41b54 commit 600ef51
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion movement/watch_faces/clock/minute_repeater_decimal_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ movement_watch_face_advisory_t minute_repeater_decimal_face_advise(void *context
movement_watch_face_advisory_t retval = { 0 };

if (state->signal_enabled) {
watch_date_time_t date_time = movement_get_utc_date_time();
watch_date_time_t date_time = movement_get_local_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion movement/watch_faces/clock/repetition_minute_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ movement_watch_face_advisory_t repetition_minute_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };

if (state->signal_enabled) {
watch_date_time_t date_time = movement_get_utc_date_time();
watch_date_time_t date_time = movement_get_local_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion movement/watch_faces/clock/simple_clock_bin_led_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ movement_watch_face_advisory_t simple_clock_bin_led_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };

if (state->signal_enabled) {
watch_date_time_t date_time = movement_get_utc_date_time();
watch_date_time_t date_time = movement_get_local_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion movement/watch_faces/clock/weeknumber_clock_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ movement_watch_face_advisory_t weeknumber_clock_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };

if (state->signal_enabled) {
watch_date_time_t date_time = movement_get_utc_date_time();
watch_date_time_t date_time = movement_get_local_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

Expand Down
4 changes: 2 additions & 2 deletions movement/watch_faces/complication/moon_phase_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ bool moon_phase_face_loop(movement_event_t event, void *context) {
break;
case EVENT_TICK:
// only update once an hour
date_time = movement_get_utc_date_time();
date_time = movement_get_local_date_time();
if ((date_time.unit.minute == 0) && (date_time.unit.second == 0)) _update(state, state->offset);
break;
case EVENT_LOW_ENERGY_UPDATE:
// update at the top of the hour OR if we're entering sleep mode with an offset.
// also, in sleep mode, always show the current moon phase (offset = 0).
if (state->offset || (movement_get_utc_date_time().unit.minute == 0)) _update(state, 0);
if (state->offset || (movement_get_local_date_time().unit.minute == 0)) _update(state, 0);
// and kill the offset so when the wearer wakes up, it matches what's on screen.
state->offset = 0;
// finally: clear out the last two digits and replace them with the sleep mode indicator
Expand Down
2 changes: 1 addition & 1 deletion watch-faces/sensor/activity_logging_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ movement_watch_face_advisory_t activity_logging_face_advise(void *context) {

// this will get called at the top of each minute, so all we check is if we're at the top of the hour as well.
// if we are, we ask for a background task.
retval.wants_background_task = movement_get_utc_date_time().unit.minute == 0;
retval.wants_background_task = movement_get_local_date_time().unit.minute == 0;

return retval;
}
Expand Down
2 changes: 1 addition & 1 deletion watch-faces/sensor/temperature_logging_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ movement_watch_face_advisory_t temperature_logging_face_advise(void *context) {

// this will get called at the top of each minute, so all we check is if we're at the top of the hour as well.
// if we are, we ask for a background task.
retval.wants_background_task = movement_get_utc_date_time().unit.minute == 0;
retval.wants_background_task = movement_get_local_date_time().unit.minute == 0;

return retval;
}
Expand Down

0 comments on commit 600ef51

Please sign in to comment.