mawinkler / astroweather

Asynchronous Astro Weather Forecast for Home Assistant
GNU General Public License v3.0
69 stars 9 forks source link

Bug: times do not adjust for time zone #14

Closed MisterPhoton closed 2 years ago

MisterPhoton commented 2 years ago

Hello!

Great work on the HA integration! I'm excited to roll it into my own setup. One thing I'm noticing, though, is it looks like time for sun/moon rise/set and 3-hourly forecast don't adjust for the time zone of the HA installation. I'm in Pacific time (UTC-7 in the summer, UTC-8 in the winter).

Here's what my current card looks like at 12:21 AM local time, 6/9:

image

As you can see, something wonky is going on with the rise/set times.

Please let me know if there's anything else I can provide, or do to help with troubleshooting!

mawinkler commented 2 years ago

Hi! just to ensure, have you set the correct timezone on the operating system level? Asking this, since the pyastroweatherio module does currently query this to calculate the offset.

mawinkler commented 2 years ago

Hi again, you can try the following: change within the file custom_components/astroweather/manifest.json the requirements to

    "requirements": [
        "pyastroweatherio==0.22.0.dev9"
    ],

and let me know the result after restarting your home assistant. I'm now calculating the timezone offset based on your configured longitude and latitude which makes it independent of the locally configured timezone on the system and should allow multiple AstroWeathers for different locations to work properly.

mawinkler commented 2 years ago

Should now be fixed with v0.22.0

mawinkler commented 2 years ago

I did just release the version v0.21.1