Refactor ONVIF#35222
Conversation
|
AMAZING 🎉 Few minor comments. |
There was a problem hiding this comment.
Are we planning to extract this to a library?
There was a problem hiding this comment.
This already existed in the current camera class. The same type of logic exists in the generic camera integration as well.
I've currently abstracted most of the API calls to device.py with a few in config_flow.py for validation checks during setup. It wouldn't be too far of a stretch to create a Home Assistant specific ONVIF library that further abstracts the logic if requested, though I think that's beyond the scope of this PR.
There was a problem hiding this comment.
Yes, it's out of scope for this PR. I'm interested in our plan for the future and what we consider ok or not ok.
|
@dshokouhi identified some issues with my PTZ The service still works if called with a supported type, but the warnings for unsupported operations don't work. |
|
Most PR comments addressed with a few follow-ups. The PTZ support is fine. The Amcrest camera being used says it supports the |
|
Still struggling to get PTZ working. I've tested the camera with https://github.com/agsh/onvif and PTZ is working with it so I can offer another probably flaky test subject from the h.view camera family. Looking forward to see it released so I can test it as well. |
|
Please don’t comment on merged PRs. Feel free to hit up #cameras on discord though, as I am looking for some more testers. @ me there |
Proposed change
The goals of this refactor are as follows:
There is no functionality change here other than fixing the PTZ service which was confirmed not working. This will, however, lead way for the next PR which will add support for creating sensors based on event notifications.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: