-
-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
onvif stopped working in 2021.6.z #51530
Comments
Possible fix: # homeassistant/components/onvif/device.py - L172
dt_util.get_time_zone(device_time.TimeZone or dt_util.DEFAULT_TIME_ZONE) |
Do you have the tzdata package installed ? |
On Sun, Jun 6, 2021 at 10:45 AM J. Nick Koston ***@***.***> wrote:
Do you have the tzdata package installed ?
On my host? of course, but I'm using official container images, which I
assume has tzdata installed
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#51530 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAE5R72EZX4LPWIRBUUK6LTRMRSVANCNFSM46E4LGHQ>
.
|
@bdraco do you mean this tzdata? https://pypi.org/project/tzdata/ or system package? Onvif component fail on Arch Linux, Alpine and Docker container, but it doesn't install tzdata from pypi. |
Thanks @bdraco . I missed that. How it is not breaking change I can't understand... |
ok, it's not tzdata which is missing, but bad json returned by Onvif device itself:
|
more info:
IMO this is bug in _validate_tzfile_path, it should raise ValueError on None, not crash. What do you think? Should I post bug in python3.9 issue tracker? core/homeassistant/components/onvif/device.py Lines 171 to 174 in 4007430
to something like this: def get_tzone():
if not device_time.TimeZone:
return dt_util.DEFAULT_TIME_ZONE
return (dt_util.get_time_zone(device_time.TimeZone) or dt_util.DEFAULT_TIME_ZONE)
tzone = get_tzone() so onvif module would still work. |
This works for me. By(t)e |
This one is "cleaner", doesn't it work? |
what if timezone would be set for as some garbage string eg dt_util.get_time_zone(device_time.TimeZone or dt_util.DEFAULT_TIME_ZONE) or dt_util.DEFAULT_TIME_ZONE |
But it wouldn't be a wrong event, don't you think? Because there is no logic in accepting an incorrect time zone. That's what I think, as much as it's good to prevent the code from falling into error, accepting a value that isn't correct I believe it's not a good alternative. |
@djpremier I decided to fix it in |
The problem
The camera is no longer found, error out with the following
What is version of Home Assistant Core has the issue?
core-2021.6
What was the last working version of Home Assistant Core?
core-2021.5
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
onvif
Link to integration documentation on our website
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: