Skip to content
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 onvif sensor detection and onvif stop service call #41949

Merged
merged 5 commits into from
Oct 19, 2020
Merged

Fix onvif sensor detection and onvif stop service call #41949

merged 5 commits into from
Oct 19, 2020

Conversation

Rihan9
Copy link
Contributor

@Rihan9 Rihan9 commented Oct 16, 2020

Breaking change

Proposed change

Fix the stop service call, added the Zoom and PanTilt parameters because some cameras required them.
Fix the way how home assistant detect available sensors on camera. Comment out SetSynchronizationPoint because is not always available and correct PullMessages service call. Also add rule for topic: "tns1:RuleEngine/MotionRegionDetector/Motion" and change the name of the sensor to more generic ones.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@homeassistant
Copy link
Contributor

Hi @Rihan9,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@probot-home-assistant
Copy link

Hey there @hunterjm, mind taking a look at this pull request as its been labeled with an integration (onvif) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

homeassistant/components/onvif/event.py Outdated Show resolved Hide resolved
homeassistant/components/onvif/event.py Outdated Show resolved Hide resolved
homeassistant/components/onvif/parsers.py Outdated Show resolved Hide resolved
homeassistant/components/onvif/device.py Outdated Show resolved Hide resolved
@Rihan9 Rihan9 requested a review from hunterjm October 17, 2020 10:16
Copy link
Member

@hunterjm hunterjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple additional comments. I don't have any cameras that don't support pullpoint subscriptions, so an integration like this is very hard to test. I am actually about to put up a PR that refactors the ONVIF integration to use zeep[async]==4.0.0, which replaces the aiohttp async lib. There is already a PR in the upstream library for it as well.

I'll reference this PR in the one I create, but I think I've got a slightly better approach to solving this problem. Would you mind if we waited for that and rebased this PR once it is merged?

homeassistant/components/onvif/device.py Outdated Show resolved Hide resolved
homeassistant/components/onvif/device.py Outdated Show resolved Hide resolved
@hunterjm hunterjm mentioned this pull request Oct 18, 2020
21 tasks
@Rihan9
Copy link
Contributor Author

Rihan9 commented Oct 18, 2020

Hi @hunterjm, I reply directly on your comments. For me, is not a problem to wait the merge of the other PR and check how much of this becomes unnecessary.
You can reject this PR and I reopen a new one when your's merged, if I think there is still something to do (like the stop service call fix, or the new parser method that don't seem to be part of your pr).
Or maybe can I make a PR on your forked branch for this two changes?
I'm sorry, maybe those are stupid questions and time loss, but it is my first pull request and I have an hard time on how to do it.

@hunterjm
Copy link
Member

@Rihan9 - ok, the other PR is now merged. It should hopefully no longer be required to change anything in the device capabilities call. Feel free to rebase off of dev (or open another PR, whichever you are more comfortable with) so we can include your PTZ and Event implementations. Let me know if the new method of PullPoint support detection works for your devices!

@Rihan9
Copy link
Contributor Author

Rihan9 commented Oct 19, 2020

Hi @hunterjm, I managed to do a rebase. I re-added the changes on the stop service call and add the new parser, but i still need to reformat the PullMessages call and remove the SetSynchronizationPoint call, otherwise my cam still can't work.

@Rihan9 Rihan9 requested a review from hunterjm October 19, 2020 08:50
Copy link
Member

@hunterjm hunterjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more change, then this looks good!

homeassistant/components/onvif/event.py Show resolved Hide resolved
@Rihan9 Rihan9 requested a review from hunterjm October 19, 2020 15:03
Copy link
Member

@hunterjm hunterjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more rebase off of upstream dev should fix broken tests, then I'll merge.

@hunterjm hunterjm merged commit d01a96d into home-assistant:dev Oct 19, 2020
@Rihan9 Rihan9 deleted the fix-onvif-integration branch October 19, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants