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
Sunset/Sunrise times #246
Comments
It looks like this may be a bug. The mirror shouldn't display the sunrise time until it is after sunset. |
I was going to pay closer attention today when I get home, but I wondered if it was changing it to sunrise (or sunset) when it hits a specific time. For example, sunrise would've been at 6:06am this morning, and the mirror changed around that time last night ... so is it possible that it's doing it at the 12 hour mark? As in, if it's 12 hours or less to sunrise, change to display that. If it's 12 hours or less to sunset, change to display sunset. I suspect something would be off at some point though as sunset and sunrise aren't exactly 12 hours apart ... |
I think I might know the cause of this issue. I'll mark it as a bug and look into it whenever I have time. |
Ok, just to be sure ... which version of the MM are you using? The issue @Bibliofile references is in the 'old' version. The new version uses the correct date compare and should be working fine. |
This is on v2-beta. |
In that case, it should switch depending on the time of the sunset/sunrise. You are talking about the "12 hour mark" but this isn't how it works. Whenever the sun went down, it will show the sunrise time. When the sun came up, it will show the sunset time. - Are you experiencing anything else? |
The time changes before the event, essentially. So if sunset is at 7pm, some time before that (currently over an hour before), it would change to the sunrise time. And I'm not awake to see if it does the same at sunrise... |
Than you will need to set your alarm to check it in the morning ... 😂 Any other users experiencing this issue? |
Yes, waking up early enough to see it has been on my TODO list ... I'm going to watch it closely tonight, see if I can catch it again, or if some recent update might've inadvertently fixed it. It also makes me wonder if this has anything to do with our timezone changes twice a year ... |
The joys of scripting things ... rather than taking @MichMich's suggestion of waking up early to see the change, I just scripted a 1-minute interval capture. So this is what I'm seeing. From PM to AM, the sunset/sunrise displayed time changes BEFORE sunset happens (oh, and blame OpenWeatherMap for the drastically different temperature display ... I hate their web site to be honest): However, in the morning, it happens within the refresh interval and it pretty close to what it should be: |
This is what decides what it needs to show: var now = new Date();
var sunrise = new Date(data.sys.sunrise * 1000);
var sunset = new Date(data.sys.sunset * 1000);
this.sunriseSunsetIcon = (sunrise < now && sunset > now) ? "wi-sunset" : "wi-sunrise"; So as far as I can think of, this could not cause the issue. I got the feeling open weather feeds the wrong times around the moment the issue occurs. |
Hrm, I'll see about logging that time stamp as well, and see what I get from them. |
Well, I've started to Log the data as it shows up in processWeather(). I put a Log call as soon as you fetch the sunset and sunrise times from
And then another Log call as soon as you set the
Notice the 'Displaying' time changing from sunset to sunrise, but sunset hasn't happened yet. From what I can tell, OpenWeatherMap isn't changing their data when the change happens locally. Which makes me think, somehow, somewhere, that |
Note that the change does happen correctly in the morning, in that it will not change to displaying sunset till after sunrise actually happened. |
I followed a debugging method similar to @KirAsh4, looking at the entire date string instead of just the time. I found that OpenWeatherMap is rolling over to the next day's sunrise/sunset times sometime shortly before today's sunset. In my case, the rollover only occurred 1-3 min before actual sunset, not the hour that's been reported. I'll check a few more days samples to see if variation in that rollover time would explain the discrepancy. In the meantime - If there's no objections, I'd like to take a stab at a change to keep a reference to "Next Sunrise" and "Next Sunset", in order to work around the early rollover |
@KirAsh4 Is this still an issue? |
Oh yes ... it was never addressed, or more accurately, I never looked into what's causing the early rollover. |
I recently changed the endpoint urls for the weather modules. Could you check of that solves the issue? (Dev branch) |
Yeah, this is still an issue. It flips to sunrise well before sunset. And unfortunately I've been too busy to look into it. I will also be gone all of next week. |
Not that i know... |
Didn't got any more reports of this issue. I close it for now. Fee free to reopen if necessary. |
Are the sunset and sunrise displayed times controlled? I'm noticing that it changes from one to the other rather early in my opinion. For example, sunset for me would be 7:51 PM tonight, however it changed to showing the sunrise time around or shortly after 6pm (I wasn't looking exactly when it changed). So now it displays the sunrise time, 6:06 AM, but it's just past 6pm still ... why wouldn't it keep the sunset time displayed longer before changing it to sunrise?
The text was updated successfully, but these errors were encountered: