Skip to content
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

Current Day Daily High Temperature Bug #23

Closed
cloneofghosts opened this issue Jan 27, 2023 · 6 comments
Closed

Current Day Daily High Temperature Bug #23

cloneofghosts opened this issue Jan 27, 2023 · 6 comments

Comments

@cloneofghosts
Copy link
Collaborator

I had posted this in this issue yesterday night but I figured I'd separate it out into a new thread to keep that discussion cleaner.

There's a bug with the new high/low setup for the current day after 6pm where it's using the highest forecasted temperature for the week rather than for the current day. Apparent temperature seems to be doing the same thing.

        "time": 1674622800,
        "icon": "snow",
        "summary": "Snow",
        "sunriseTime": 1674649875,
        "sunsetTime": 1674683974,
        "moonPhase": 0.14013338096939384,
        "precipIntensity": 0.927,
        "precipIntensityMax": 1.1494,
        "precipIntensityMaxTime": 1674702000,
        "precipProbability": 1.0,
        "precipAccumulation": 4.6349,
        "precipType": "snow",
        "temperatureHigh": 0.29,
        "temperatureHighTime": 1674900000,
        "temperatureLow": -9.96,
        "temperatureLowTime": 1674694800,
        "apparentTemperatureHigh": -17.87,
        "apparentTemperatureHighTime": 1674900000,
        "apparentTemperatureLow": -18.92,
        "apparentTemperatureLowTime": 1674694800,
        "dewPoint": -11.37,
        "humidity": 0.87,
        "pressure": 1000.84,
        "windSpeed": 25.74,
        "windGust": 57.69,
        "windGustTime": 1674702000,
        "windBearing": 77.96,
        "cloudCover": 1.0,
        "uvIndex": 0.06,
        "uvIndexTime": 1674691200,
        "visibility": 0.68,
        "temperatureMin": -9.96,
        "temperatureMinTime": 1674694800,
        "temperatureMax": -9.21,
        "temperatureMaxTime": 1674702000,
        "apparentTemperatureMin": -18.92,
        "apparentTemperatureMinTime": 1674694800,
        "apparentTemperatureMax": -17.87,
        "apparentTemperatureMaxTime": 1674687600

If I convert 1674900000 into date/time format I get this: Saturday, January 28, 2023 5:00:00 AM GMT-05:00 which isn't even remotely close to the current day so it shouldn't be used here. Before 6pm today it was showing -9 as the high temperature which is much more reasonable.

Using the current temperature would be the easiest solution but I know other sites after a certain time no longer give a value for the high temperature. I'm not sure if it's possible to compare to the previous value and take the highest value or maybe have a min/max since 7am and use that for the high temperature instead? Just throwing out ideas to see what might work.

@alexander0042
Copy link
Collaborator

Thanks for creating a new issue, since I see what you're saying here. I've been thinking about this within the context of issue #5, and I think it makes the most sense to return the high temperature for the day, even if it's in the past. I thought of a better way to do this that will only add one additional file check, which isn't too bad at all, which should solve both issues in one change!

@cloneofghosts
Copy link
Collaborator Author

@alexander0042 Any updates here? I know you mentioned in that other task that you were going to work on it that upcoming weekend but haven't heard anything or seen any updates since.

@alexander0042
Copy link
Collaborator

Thanks for pinging about this- it's one of those things that I though "how hard can this be", and then ended up being very difficult. It's partially working at this point, so hopefully won't be too much longer!

@cloneofghosts
Copy link
Collaborator Author

@alexander0042 Any progress on this? Currently it's showing a high temperature of 25C which is very incorrect as it's not forecasted to occur until next week. 1681506000 in UNIX time or Friday, April 14, 2023 5:00:00 PM GMT-04:00 DST

@cloneofghosts cloneofghosts changed the title Daily High Temperature Bug Current Day Daily High Temperature Bug Apr 11, 2023
@cloneofghosts
Copy link
Collaborator Author

@alexander0042 While you're working on the permanent fix would a temporary solution be to just use the current temperature as the high temp so it doesn't show a temperature that could be forecasted a week from now? I think that's how it used to work before things broke when you were trying to initially fix the issue.

@cloneofghosts
Copy link
Collaborator Author

Going to merge discussion into #5 to clean up the repo a bit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants