-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix wrong time format #98
Conversation
Please change also the test data in data_station.json |
Sorry didn't see that, WIP |
The metadata timestamp format has also changed, which means that data_metadata.json is basically also incorrect. |
True, but I don't think the dates from the metadata are used anywhere. I have changed them in the data_metadata.json, just in case. |
@killer0071234 also curious why you don't parse the timezone offset like so >>> fixed_tz = datetime.strptime("2022-12-15T10:30+00:00", "%Y-%m-%dT%H:%M+00:00").replace(tzinfo=zoneinfo.ZoneInfo("Europe/Vienna"))
datetime.datetime(2022, 12, 15, 10, 30, tzinfo=zoneinfo.ZoneInfo(key='Europe/Vienna'))
>>> parsed_tz = datetime.strptime("2022-12-15T10:30+00:00", "%Y-%m-%dT%H:%M%z")
datetime.datetime(2022, 12, 15, 10, 30, tzinfo=datetime.timezone.utc)
>>> parsed_tz - fixed_tz
datetime.timedelta(seconds=3600) |
This part of the code I took over from the old Zamg integration, and did not dig into it that deep |
That's true, this part is just copied in from a real reply and we are just using the possible stations out of it. |
Codecov ReportBase: 95.54% // Head: 95.54% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
=======================================
Coverage 95.54% 95.54%
=======================================
Files 3 3
Lines 157 157
Branches 22 22
=======================================
Hits 150 150
Misses 5 5
Partials 2 2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
The timezone is one problem then it was working OK |
closes #97
home-assistant/core#83988
as @steinerl said
it looks like the ZAMG changed their timestamp format.
I'm also not sure if this is a permanent change...