Okay, I have seen lots of requests for a Sunrise feature. Let’s get what we want on ‘paper’.
I know there is a sunrise button in the UI, but that seems to only set the current sunrise for that day. It doesn’t seem to be dynamic.
This setup requires at least an intermittent internet connection.
User Configuration:
- Select Dynamic Sunrise option (obviously)
- Set a +/- offset in minutes from dynamic time
- Have a setting for dynamic or static longitude/latitude. Dynamic uses the device’s low accuracy GPS location to get latitude and longitude.
Functionally
Background task
- Gets lat/long from GPS or set static lat/long
- Makes API call to https://sunrise-sunset.org/api to get
- Converts API time (UTC) to local time
- Applies User configured offset to alarm time
- Sets alarm time in the Android alarm subsystem
This task should probably run about 4 times a day in case the device is moving timezone/long/lat.