Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UVC camera platform handling unavailable NVR or cameras better #14864

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

Merged
merged 3 commits into from
Jun 9, 2018

Conversation

exxamalte
Copy link
Contributor

@exxamalte exxamalte commented Jun 8, 2018

Description:

Fixes #14838 by surrounding all interactions with the NVR or cameras into a try-block and catching and handling any exceptions during the initial setup of the component. Also, raising PlatformNotReady in those cases that are likely recoverable to make HA try the setup again after 30 seconds. Some test cases corrected that were previously wrong (but not failing). Some test cases modified and some added to test the modified or new functionality.

Related issue (if applicable): fixes #14838

Pull request in home-assistant.github.io with documentation (if applicable): n/a

Example entry for configuration.yaml (if applicable): n/a

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

exxamalte added 2 commits June 8, 2018 09:07
…g tests must be separated out to ensure that the setup_component call is actually executed
Copy link
Member

@syssi syssi left a comment

Choose a reason for hiding this comment

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

LGTM

@syssi syssi merged commit f242418 into home-assistant:dev Jun 9, 2018
@ghost ghost removed the in progress label Jun 9, 2018
@balloob balloob mentioned this pull request Jun 22, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
…assistant#14864)

* fixed tests: using correct camera configuration now and error handling tests must be separated out to ensure that the setup_component call is actually executed

* better error handling during setup; raising PlatformNotReady in likely recoverable cases; added tests
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UVC camera in unrecoverable state when unavailable during startup
3 participants