Revert PR #470 - implement automatic DST toggling

The DST code has not yet been fully tested, the upcoming movement
refactor is upon us and it will integrate with the micro timezone
library anyway. Revert it so that next can be merged into main.

This reverts commit ac5bf8cfce, reversing
changes made to 5a8a49a8c7.
This commit is contained in:
Matheus Afonso Martins Moreira
2024-09-17 17:08:32 -03:00
parent 683032219e
commit a9d503b807
32 changed files with 165 additions and 296 deletions

View File

@@ -134,8 +134,7 @@ static void _planetary_solar_phases(movement_settings_t *settings, planetary_hou
state->no_location = false;
watch_date_time date_time = watch_rtc_get_date_time(); // the current local date / time
int16_t tz = get_timezone_offset(settings->bit.time_zone, date_time);
watch_date_time utc_now = watch_utility_date_time_convert_zone(date_time, tz * 60, 0); // the current date / time in UTC
watch_date_time utc_now = watch_utility_date_time_convert_zone(date_time, movement_timezone_offsets[settings->bit.time_zone] * 60, 0); // the current date / time in UTC
watch_date_time scratch_time; // scratchpad, contains different values at different times
watch_date_time midnight;
scratch_time.reg = midnight.reg = utc_now.reg;
@@ -148,7 +147,7 @@ static void _planetary_solar_phases(movement_settings_t *settings, planetary_hou
double lon = (double)lon_centi / 100.0;
// save UTC offset
state->utc_offset = ((double)tz) / 60.0;
state->utc_offset = ((double)movement_timezone_offsets[settings->bit.time_zone]) / 60.0;
// calculate sunrise and sunset of current day in decimal hours after midnight
sun_rise_set(scratch_time.unit.year + WATCH_RTC_REFERENCE_YEAR, scratch_time.unit.month, scratch_time.unit.day, lon, lat, &sunrise, &sunset);
@@ -239,7 +238,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
// get current time
watch_date_time date_time = watch_rtc_get_date_time(); // the current local date / time
watch_date_time utc_now = watch_utility_date_time_convert_zone(date_time, get_timezone_offset(settings->bit.time_zone, date_time) * 60, 0); // the current date / time in UTC
watch_date_time utc_now = watch_utility_date_time_convert_zone(date_time, movement_timezone_offsets[settings->bit.time_zone] * 60, 0); // the current date / time in UTC
current_hour_epoch = watch_utility_date_time_to_unix_time(utc_now, 0);
// set the current planetary hour as default screen