Allow filtering of sources for Android TV#30994
Conversation
|
@JeffLIrion instead of blacklisting apps you don't want to see, it might be nicer/easier or at a minimum a nice alternative to be able to whitelist apps you do want to see. Just food for thought, happened to see this PR while checking on the status of another one. Thanks for adding this btw, makes support to launch an app much more useful! |
This was just a quick feature enhancement. If someone has a better way to allow for filtering sources, that would be welcome. My 2nd generation Fire TV stick never has more than a few apps open at a time, and I rarely view the sources list in Lovelace, so including all the running apps has never been an issue for me. |
|
I have an idea on how this could be implemented. Once this is approved I can put up a proposal PR for you to review |
raman325
left a comment
There was a problem hiding this comment.
Looks good to me once a decision is made on my comments
|
Just wanted to comment based on what I have seen other integrations such as the recorder or history do when it comes to filtering. They usually do one of 2 things an |
|
The nice thing about @dshokouhi 's proposal is that it would handle the whitelist use case I had mentioned earlier |
Omitting some config stuff: # 1. Include all apps
apps:
first.app: "First app"
second.app: "Second app"
# 2. Don't include any apps
get_sources: false # I think this would accomplish that because the only
# app in the sources list would be the current app
# 3. You have lots of apps and only want to include a few
exclude_unnamed_apps: true # default value is false to preserve current behavior
apps:
first.app: "First app"
second.app: "Second app"
# 4. You have lots of apps and want to include most
apps:
first.app: "First app"
second.app: "Second app"
third.app: # will never be shown
fourth.app: "" # will never be shownI think this solution of adding a config parameter |
|
Follow-up This commit implements the approach described in my previous post: JeffLIrion@0842b22 If you guys think that’s a good solution, I’ll merge it into the pull request branch. |
I think this helps simplify things and allows users to decide how best to setup their apps depending on their use cases. The default value you chosen is also good to keep existing behavior. |
|
I merged in that change and the checks passed. @dshokouhi would you mind reviewing this pull request? |
|
@dshokouhi and @raman325 thanks for reviewing! Now I just need someone with merge rights to review it👍 |
|
Well, I haven't merged other people's PRs yet, but this one looks pretty straight forward, and there are already two approvals, so I'll go ahead and merge it. If I'm going to help out more I guess I've got to jump in somewhere! 😃 |
|
Thanks @pnbruckner! |
Description:
If you don't want an app to show up in your sources list, you can leave its friendly name empty or give it an empty string as its friendly name in the
appsconfiguration entry. You can also setexclude_unnamed_apps: trueso that all apps that do not have a friendly name provided by you or provided by default in the backend library will not be shown in the sources list.Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11816
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices: