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

Improve uvc test camera #41438

Merged
merged 21 commits into from
Mar 19, 2021
Merged

Conversation

sycx2
Copy link
Contributor

@sycx2 sycx2 commented Oct 7, 2020

Breaking change

  • The datetime returned in the last_recording_start_time state attribute of the uvc camera entity was changed from local time to be UTC time. All times in state attributes must be UTC time. Users should update any automations or scripts that depend on this state attribute.

Proposed change

Improves the tests for the uvc camera by rewriting tests to async pytest functions.
I changed a lot in this test so it may need some review.
Also I got a logical understanding problem which you can find in the mentioned issue or at this link:
#40906 (comment)

All tests are passing.

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

Additional information

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:

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

Copy link
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

@sycx2: This looks good, but needs to be rebased as there is a new test test_motion_recording_mode_properties added on dev branch.

@MartinHjelmare MartinHjelmare self-assigned this Mar 18, 2021
@MartinHjelmare MartinHjelmare marked this pull request as ready for review March 18, 2021 21:03
@MartinHjelmare MartinHjelmare removed their assignment Mar 18, 2021
@emontnemery emontnemery merged commit bc0eb9b into home-assistant:dev Mar 19, 2021
raman325 pushed a commit to raman325/home-assistant that referenced this pull request Mar 24, 2021
* Improve uvc test camera

* Clean setup full config

* Clean setup partial config

* Set more camera defaults

* Clean setup partial config v31x

* Clean setup incomplete config

* Clean setup nvr errors during indexing

* Clean setup nvr errors during initialization

* Clean properties

* Fix motion recording mode properties

* Clean stream

* Clean login

* Clean login v31x

* Clean login tries both addres and caches

* Clean login fails both properly

* Remove not needed test

* Clean camera image error

* Test snapshot login retry

* Clean up

* Test enable and disable motion detection

* Times must be UTC

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.

Rewrite uvc unittest tests to pytest style test functions
4 participants