LibreShift / red-moon

Android screen filter app for night time phone use.
GNU General Public License v3.0
650 stars 81 forks source link

Respect daylight saving time with location based filter times #134

Closed katsel closed 7 years ago

katsel commented 7 years ago

I have "Filter times" set to "Times from location", to adjust color temperature based on sunrise/sunset. Worked perfectly so far, I'm really enjoying that feature of Red Moon.

We went to daylight saving time last night. Android adjusts time settings of my device automatically when that happens. However, Red Moon did not adapt to that change and switched to night mode 1 hour too early.

I would suggest to make Red Moon aware of daylight saving time if "Times from location" is enabled.

Side note: I just rebooted my phone to see if this helps with the issue, and I can report back if it worked (in case that's interesting). Still, if it's possible to have a fix that doesn't require reboot, that'd be more user friendly.

I'm using version 2.10.1.

smichel17 commented 7 years ago

Red moon should use the phone's time to schedule, and each event is scheduled when the previous one happens. So, I suspect that it will correct itself after a cycle or two.

You can also force the times to reschedule by turning the timer off and on again.

katsel commented 7 years ago

@smichel17: I tried your suggestion of disabling/enabling the timer, but I still showing got incorrect sunrise/sunset times.

I got it working as follows:

  1. enable GPS
  2. switch "Times from location" off and on again.

This corrected the times. I'm wondering why this is not working automatically.

I noticed that it's not just a daylight saving time issue. Once you enable "Times from location", Red Moon seems to stick with sunrise/sunset times from that very day. As sunrise/sunset times change every single day by a few minutes, the offset can add up to 1/2 hour+ in just a few weeks.

Sunrise/sunset times need to be updated every single day based on the stored location - otherwise, it's just as inflexible as adding those times manually.

smichel17 commented 7 years ago

@katsel Current behavior is that new sunrise/sunset times are calculated each time a new location is found. I agree we should recalculate times from the stored location, each day.

There's some incidental improvement to that in v2.10.2 because the location will be automatically updated more often; I'll do the full fix in v3.0.1.

katsel commented 7 years ago

Sounds good to me. Thanks for taking care of this!