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

Add all object sensor to camera and zone devices #224

Merged
merged 9 commits into from
Mar 11, 2022

Conversation

NickM-27
Copy link
Sponsor Collaborator

@NickM-27 NickM-27 commented Mar 6, 2022

Fix for #161

Related frigate PR: blakeblackshear/frigate#2908

@codecov
Copy link

codecov bot commented Mar 6, 2022

Codecov Report

Merging #224 (a338b6b) into master (63bc04f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #224   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1278      1286    +8     
=========================================
+ Hits          1278      1286    +8     
Impacted Files Coverage Δ
custom_components/frigate/__init__.py 100.00% <100.00%> (ø)
custom_components/frigate/binary_sensor.py 100.00% <100.00%> (ø)
custom_components/frigate/sensor.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63bc04f...a338b6b. Read the comment docs.

@dermotduffy
Copy link
Collaborator

Would you mind adding a test that verifies that the entity is not present at first, then is present when enabled? For inspiration, see: https://github.com/dermotduffy/hass-core/blob/dev/tests/components/hyperion/test_switch.py#L187

Key bit:

  updated_entry = entity_registry.async_update_entity(
      entity_id, disabled_by=None
  )

Otherwise, looks great to me.

In terms of merging, I'd suggest we wait until blakeblackshear/frigate#2908 is in, just in case there is feedback upstream.

@NickM-27
Copy link
Sponsor Collaborator Author

NickM-27 commented Mar 7, 2022

@dermotduffy Let me know what you think of the tests I added. And yeah I agree will want to wait until frigate PR is merged 👍

tests/test_sensor.py Outdated Show resolved Hide resolved
@dermotduffy
Copy link
Collaborator

@NickM-27 Looking good! Minor typo.

@NickM-27
Copy link
Sponsor Collaborator Author

@dermotduffy The upstream frigate PR was just merged

@dermotduffy dermotduffy added enhancement New feature or request and removed pending labels Mar 11, 2022
@dermotduffy dermotduffy merged commit 400ab71 into blakeblackshear:master Mar 11, 2022
@dermotduffy
Copy link
Collaborator

Thanks for the great work @NickM-27 !

@NickM-27 NickM-27 deleted the all-object-sensor branch March 11, 2022 02:43
@dermotduffy dermotduffy changed the title FEAT: Add all object sensor to camera and zone devices Add all object sensor to camera and zone devices May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants