-
-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleWeatherService: Add sunrise and sunset data #2100
base: main
Are you sure you want to change the base?
Conversation
Build size and comparison to main:
|
b42424e
to
3cf3eb9
Compare
2f6288d
to
c7a50f9
Compare
Woult it be enough to have the sunset and sunrise in minutes resolution. If so we could define the sunset sunrise timestamps to be in minutes since midnight. Then we only need What do you think? |
I like this idea. A quick/naïve implementation would be to truncate the timestamp that Gadgetbridge sends, and we pad it when calculating the actual time, but then the resolution becomes arbitrary. What you're suggesting instead is Gadgetbridge essentially doing something like -long sunriseLocal = weatherSpec.sunRise + Calendar.getOffset("UTC").getTimeInMillis()) / 1000L;
+int sunriseLocal = (weatherSpec.sunRise + Calendar.getOffset("UTC").getTimeInMillis()) / 1000L) / 60; (or whatever the type conversion looks like) I'll give that a try and see what happens. |
Ah, nevermind - I see what you're suggesting. Diving the timestamp doesn't really change the size. Math is hard 🤦 |
c7a50f9
to
76a50a4
Compare
76a50a4
to
c57bbee
Compare
c57bbee
to
def20a0
Compare
To test with InfiniSim with |
def20a0
to
d6ab2e9
Compare
d6ab2e9
to
86f3679
Compare
86f3679
to
d06bb24
Compare
This receives sunrise and sunset data from the weather service and adapts weather icons to represent the correct time of day (sun or moon).
It requires a new version of the weather service data byte array.