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

All icons are night icons #79

Closed
ion1 opened this issue Jun 30, 2023 · 4 comments
Closed

All icons are night icons #79

ion1 opened this issue Jun 30, 2023 · 4 comments
Labels

Comments

@ion1
Copy link

ion1 commented Jun 30, 2023

It seems all icons which can have a "day" or "night" suffix use "night" despite the sun being up at this location. The response to https://api.pirateweather.net/forecast/.../61.4981,23.7604?exclude=minutely,hourly,daily,alerts at 14:56 local time:

{
	"latitude": 61.4981,
	"longitude": 23.7604,
	"timezone": "Europe/Helsinki",
	"offset": 3.0,
	"elevation": 354,
	"currently": {
		"time": 1687348560,
		"summary": "Clear",
		"icon": "clear-night",
		"nearestStormDistance": 0,
		"nearestStormBearing": 0,
		"precipIntensity": 0.0,
		"precipProbability": 0.0,
		"precipIntensityError": 0.0,
		"precipType": "none",
		"temperature": 84.47,
		"apparentTemperature": 84.65,
		"dewPoint": 45.01,
		"humidity": 0.25,
		"pressure": 999.85,
		"windSpeed": 8.124,
		"windGust": 11.59,
		"windBearing": 247.73,
		"cloudCover": 0,
		"uvIndex": 6.0,
		"visibility": 10.0,
		"ozone": 313.92
	},
	"flags": {
		"sources": [
			"ETOPO1",
			"gfs",
			"gefs"
		],
		"sourceTimes": {
			"gfs": "2023-06-21 06:00:00",
			"gefs": "2023-06-21 00:00:00"
		},
		"nearest-station": 0,
		"units": "us",
		"version": "V1.5.2"
	}
}
@alexander0042
Copy link
Collaborator

Thanks for bringing this up- I hadn't noticed it before, but I can verify it's still an issue for this region. The icons are working correctly in North America; however, I can also see that the sunrise/ sunset times are not working, so I think that's the root problem here. I'll dig into this and get back with a fix ASAP!

@alexander0042
Copy link
Collaborator

Ok, got it, another literal edge (of the map) case! The issue here was with the error handling when there isn't a sunset, since the algorithm defaulted to assuming it was always night, instead of working out if it should be always day or night. I fixed this by checking the month and location, and then picking "always day" or "always night" from there. The API will then return a sunrise of 1 second after midnight and 1 second before midnight in the case of "always day", or a sunrise of 2 seconds before midnight and a sunset 1 second before midnight for "always night". I'll make version 1.5.3 with this change live shortly, and update the changelog/ docs with this corrected approach.

Thanks again for pointing this out, and let me know if you run into any other issues.

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

There has not been any activity on this issue in the last ninety and will automatically close in seven days. Comment on this issue to prevent this issue from closing automatically.

@github-actions github-actions bot added the stale label Oct 4, 2023
@github-actions
Copy link

This issue has been automatically closed since there has been no further activity after seven days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants