-
Notifications
You must be signed in to change notification settings - Fork 315
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
Add methods to set/get devices time zone #1971
Conversation
I was going about this all backwards, it just hit me we can just add Ready for testing :-)
Corresponding BE logs responses
|
Sorry, just saw it now. What benefit would this bring? (considering we will have to change how alarm works) |
To be honest, it's just convenience/nice to have. I am sure a lot of users like me set this up manually right now on each instance.. Some SSL certificate errors pop up at times when the clock is not synced, but I don't see any core functionality issues of sticking to (ntp synced) UTC. Another advantage is supporting display plugins that have a clock while on standby. Else each plugin has to individually configure the time zone. ( E.g |
it's useful for clock display on mdp_oled |
@Darmur I suggest not to use mpd oled: this will show only MPD metadata, and not all other services. |
I'll have a look to mpd_oled, thanks for the suggestion. BTW, I think even if it will be ported to node, proper timezone setting will be required to show the clock on display while not playing |
If we add this method, then we need to refactor the whole alarm plugin time calculation... |
OK, I didn't look to the alarm plugin implementation to be honest. What I don't understand, if the plugin diff the browser time, why is it an issue to set a different time zone? In theory if you set your alarm after setting new time-zone and after a reboot, the delta should still be computed properly. |
I can confirm changing time-zone does not affect Alarm plugin. This is the test I did:
It works fine, alarms were triggered right on time |
Probably still valid, but given the time that has passed, it is probably better to rebase onto |
Added some methods to set and get the current time zone.
There is lot of scope of improvement, astimedatectl
requires currently needssudo
perms.If only I had read the docs, instead of skimming down to what I needed.--no-ask-password
That also doesn't work, we just have to use the tried and tested
NOPASSWD
Roundabout method
We could set up
policykit
to allow the volumio user to usetimedatectl
, but I need to explore that more. Something along these lines should work..On the FE side, we could pick up the current time zone from the browser in the wizard with
Intl.DateTimeFormat().resolvedOptions().timeZone
. Or, for a more wholesome experience, I am sure we can also find some angular lib for time zone selection..Partially fixes #373 #741
PS: Also included preliminary tests that can be run on the device (with Volumio running)