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 an 'update' entity to report new versions of the Frigate backend #237

Merged
merged 32 commits into from
Apr 22, 2022

Conversation

NickM-27
Copy link
Collaborator

@NickM-27 NickM-27 commented Apr 1, 2022

Implements #235

Based off of WLED implementation as that is one of the few available for reference. Pre-requisite frigate PR is blakeblackshear/frigate#3038

@dermotduffy
Copy link
Collaborator

@NickM-27 I'll leave this alone until the build passes -- just use the 'Request review' whenever you're ready.

@NickM-27
Copy link
Collaborator Author

NickM-27 commented Apr 2, 2022

@NickM-27 I'll leave this alone until the build passes -- just use the 'Request review' whenever you're ready.

Haha yeah it'll be a WIP, I may have some questions once I get further, but need to wait until the frigate PR is finalized since I've had some comments.

@NickM-27
Copy link
Collaborator Author

According to the update entity docs it can support showing the changelog, but it would need to pull it down separately and also has a max length 255 characters which is much shorter than frigate full releases typically are, so probably best to leave that out.

@NickM-27
Copy link
Collaborator Author

Relevant Screenshots

Frigate Main Device Entity List

Screen Shot 2022-04-11 at 1 00 03 PM

Viewing Entity

Screen Shot 2022-04-11 at 1 00 13 PM

Artificially Created Update Scenario

Screen Shot 2022-04-11 at 1 02 14 PM

@NickM-27
Copy link
Collaborator Author

NickM-27 commented Apr 11, 2022

@dermotduffy It seems to be complaining that it can't find the update entity, I figured that the tests would automatically use the latest HA version?

Edit: I updated the reqs to require the newest HA

@NickM-27
Copy link
Collaborator Author

@dermotduffy I may need some help with these tests, not sure what changed in HA that makes media_source miss so many

@NickM-27
Copy link
Collaborator Author

@dermotduffy any thoughts on this? not sure if these tests are broken or if there is full functionality broken in HASS 2022.4?

@NickM-27
Copy link
Collaborator Author

🤞 once #242 gets merged, I can redo this and it will be passing, not too sure though with the changes to HA calls

@dermotduffy
Copy link
Collaborator

As discussed on discord, try again after rebasing to #243 (and install the new requirements). You may have more luck.

@NickM-27 NickM-27 force-pushed the #235_update_entity branch from 0d1026e to 01f410a Compare April 20, 2022 13:08
@NickM-27
Copy link
Collaborator Author

Okay just realized my error here being that I can't access the object attributes from the entity state

@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #237 (b63e56f) into master (65e5ec0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #237   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        11    +1     
  Lines         1325      1373   +48     
=========================================
+ Hits          1325      1373   +48     
Impacted Files Coverage Δ
custom_components/frigate/const.py 100.00% <100.00%> (ø)
custom_components/frigate/update.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 65e5ec0...b63e56f. Read the comment docs.

@NickM-27
Copy link
Collaborator Author

@dermotduffy should be good for review

@NickM-27
Copy link
Collaborator Author

Cool, that seems to have done it

@dermotduffy dermotduffy changed the title #235 update entity Add an 'update' entity to report new versions of the Frigate backend Apr 21, 2022
@dermotduffy dermotduffy added the enhancement New feature or request label Apr 21, 2022
@NickM-27 NickM-27 requested a review from dermotduffy April 22, 2022 03:17
@dermotduffy dermotduffy merged commit 18022f7 into blakeblackshear:master Apr 22, 2022
@dermotduffy
Copy link
Collaborator

Thanks @NickM-27 !

@felipecrs
Copy link
Contributor

felipecrs commented May 14, 2022

I think I would prevent the creation of this update entity in case Frigate is known to be installed via the addon, otherwise there would be two update entities for the same thing, basically (as Supervisor already provides it).

@NickM-27 NickM-27 deleted the #235_update_entity branch May 14, 2022 17:42
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.

3 participants