generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Ability to disable media browser #262
Merged
dermotduffy
merged 19 commits into
blakeblackshear:master
from
NickM-27:disable-media-browser
May 28, 2022
Merged
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
77c1cb7
Add option for media browser and add translations
NickM-27 dfa8c6c
Get config entry correctly
NickM-27 4e995f4
Add media browser disabled test
NickM-27 713f1ad
Add test to config_flow
NickM-27 e77dccc
Quick fixes
NickM-27 b17bcb1
catch exception
NickM-27 a34195b
Get media source directly
NickM-27 c03408f
Expect error to be raised
NickM-27 3cb4071
Check all HA media browsers
NickM-27 51f9f3e
Remove unused var
NickM-27 92f196f
Reset media source
NickM-27 e1c04a9
Check for the instance ID
NickM-27 94710a0
Check for the instance ID
NickM-27 9ef2f93
Disallow media source if disabled
NickM-27 893b6e8
Typing fixes
NickM-27 5f5f227
Typing fixes
NickM-27 7e8d2de
Merge branch 'master' of github.com:blakeblackshear/frigate-hass-inte…
NickM-27 4b78d47
Check for identifier frigate id
NickM-27 f926c2a
Fix tests.
dermotduffy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[With apologies in advance for re-thinking this] I think I have a much better idea. Leave this method the way it used to be, and check the option in
FrigateMediaSource
.Suggestion on how to do this (pardon the verbosity as this file is quite complex). You'll need to add a new method such as
_isAllowedAsMediaSource
that takes afrigate_instance_id
and returnsTrue
if for that instance_id, in the config entry (which can you get by callingget_config_entry_for_frigate_instance_id
) the option is set correctly.Then call that verification method in these places (in all cases you can get the
frigate_instance_id
from the identifer asidentifier.frigate_instance_id
).async_resolve_media
[here]async_browse_media
[here]async_browse_media
[here]This is much better because if I have 3 Frigate instances, and I disable the media for 1 of them, media will still work as usual for the other 2 rather than 'all or nothing'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, that's a much better solution, will jump on that tomorrow.
The test will probably need to be tweaked as well