Skip to content

Commit

Permalink
Merge pull request #53 from DerOetzi/forecast
Browse files Browse the repository at this point in the history
Fix timezone problem with daylight saving time
  • Loading branch information
DerOetzi authored Apr 1, 2024
2 parents a6ade3b + f23b3a5 commit fb51799
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ scikit-learn==1.4.1.post1
aiohttp==3.9.3
aiocsv==1.3.1
astral==3.2
ephem==4.1.5
ephem==4.1.5
tzlocal==5.2
4 changes: 2 additions & 2 deletions solaredge2mqtt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from functools import lru_cache
from os import environ, listdir, path
from time import localtime, strftime
from typing import Generator
from tzlocal import get_localzone_name

from pydantic import BaseModel, Field, SecretStr

Expand All @@ -16,7 +16,7 @@
SECONDS_PER_YEAR = SECONDS_PER_DAY * 365
SECONDS_PER_2_YEARS = SECONDS_PER_YEAR * 2

LOCAL_TZ = strftime("%Z", localtime())
LOCAL_TZ = get_localzone_name()


class ModbusSettings(BaseModel):
Expand Down

0 comments on commit fb51799

Please sign in to comment.