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 #235

Closed
NickM-27 opened this issue Mar 30, 2022 · 6 comments
Closed
Labels
enhancement New feature or request

Comments

@NickM-27
Copy link
Collaborator

Home assistant just released update entities in the latest beta. I am wondering, would it be a good idea to add an update entity for frigate?

Ex: Frigate Container has a new update! I believe we could use the host-url to also send people to the add-on page if it is confirmed to be an addon. Anyway, I'm happy to work on this if it is agreed upon, curious on everyone's thoughts?

@NickM-27 NickM-27 changed the title Support for new update entities? Support for new "update" entity? Mar 30, 2022
@dermotduffy
Copy link
Collaborator

Hi Nick, sounds good to me. Does the Frigate backend support such a thing? Without wanting to make this more complicated, I could imagine one good path to be to have the Frigate backend detect this itself and then notify HA via MQTT. This would then also all the Frigate UI to show a similar message.

@dermotduffy dermotduffy added the enhancement New feature or request label Apr 1, 2022
@NickM-27
Copy link
Collaborator Author

NickM-27 commented Apr 1, 2022

@dermotduffy Interesting, Frigate provides the version in the /api/stats endpoint so I was thinking of comparing that to the latest tag on GitHub. I could go either way 🤔

@dermotduffy
Copy link
Collaborator

dermotduffy commented Apr 1, 2022

Frigate provides the version in the /api/stats endpoint

... yeah but not the latest available. That might make a slightly easier compromise: add a 'latest_version' to that exported JSON with the tag you get from GitHub, then have the update entity just compare the two. The Frigate web UI could be modified to use that similarly later -- but you wouldn't have to do that now.

Motivation: The github tag reading would be done once, and the integration wouldn't need to talk to the internet.

@NickM-27
Copy link
Collaborator Author

NickM-27 commented Apr 1, 2022

Yeah that's fair, makes sense to want to avoid having the integration hit any WAN endpoints. Also curious, I haven't seen any guidance on when / polling for the update entity so I figure just checking in __init__ would suffice since the easiest logic would just be for frigate to check on startup as well (or the first time that the /stats/ endpoint is hit).

@dermotduffy
Copy link
Collaborator

Yeah that's fair, makes sense to want to avoid having the integration hit any WAN endpoints. Also curious, I haven't seen any guidance on when / polling for the update entity so I figure just checking in init would suffice since the easiest logic would just be for frigate to check on startup as well (or the first time that the /stats/ endpoint is hit).

I'd get it from the FrigateDataUpdateCoordinator, it's already polling /api/stats every 5 seconds so you get that for 'free'! An example of that in action is the FrigateFpsSensor (ref).

@dermotduffy dermotduffy changed the title Support for new "update" entity? Add an 'update' entity to report new versions of the Frigate backend being available Apr 1, 2022
@dermotduffy dermotduffy changed the title Add an 'update' entity to report new versions of the Frigate backend being available Add an 'update' entity to report new versions of the Frigate backend Apr 1, 2022
@NickM-27
Copy link
Collaborator Author

NickM-27 commented Apr 1, 2022

Oh even better, I like free 🤑

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

No branches or pull requests

2 participants