OpenWeather icon indicating copy to clipboard operation
OpenWeather copied to clipboard

Feature request: Add timezone_offset

Open llamaonaskateboard opened this issue 2 years ago • 3 comments

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.

llamaonaskateboard avatar Oct 06 '23 02:10 llamaonaskateboard

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!

Bodmer avatar Oct 06 '23 11:10 Bodmer

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 avatar Oct 06 '23 11:10 llamaonaskateboard

I forgot that I locally fixed this so raised a PR for you https://github.com/Bodmer/OpenWeather/pull/19 fullDataSet() only gets called for onecall so the change is as simple as changing the JSON field from timezone to timezone_offset

llamaonaskateboard avatar Jan 05 '24 07:01 llamaonaskateboard