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

Feature request: Add timezone_offset #15

Open
llamaonaskateboard opened this issue Oct 6, 2023 · 3 comments
Open

Feature request: Add timezone_offset #15

llamaonaskateboard opened this issue Oct 6, 2023 · 3 comments

Comments

@llamaonaskateboard
Copy link
Contributor

Can you add timezone_offset as a public member to OW_Weather, just like timezone?
This would make local timezone conversions much easier instead of relying on another library or lookup table to convert the timezone.

@Bodmer
Copy link
Owner

Bodmer commented Oct 6, 2023

The timezone value for the forecast API is the offset. See here:

https://openweathermap.org/forecast5

Yes, the name is misleading, but that is down to the API, not this library!

@llamaonaskateboard
Copy link
Contributor Author

Of course the onecall API schema just has to be different to forecast…
It has both a timezone and timezone_offset.
https://openweathermap.org/api/one-call-3#example

llamaonaskateboard added a commit to llamaonaskateboard/OpenWeather that referenced this issue Jan 5, 2024
The onecall API returns the numeric timezone offset in the `timezone_offset` field, unlike the forecast API which returns it in the `offset` field.
Refer Bodmer#15
llamaonaskateboard added a commit to llamaonaskateboard/OpenWeather that referenced this issue Jan 5, 2024
The onecall API returns the numeric timezone offset in the `timezone_offset` field, with the text offset in the `timezone` field.
This is different to the forecast API which returns the numeric offset in the `timezone` field. 
Refer Bodmer#15
@llamaonaskateboard
Copy link
Contributor Author

I forgot that I locally fixed this so raised a PR for you #19
fullDataSet() only gets called for onecall so the change is as simple as changing the JSON field from timezone to timezone_offset

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

No branches or pull requests

2 participants