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

Default to app icon if icon is not available for notification #2936

Merged

Conversation

dshokouhi
Copy link
Member

Summary

Default back to the app icon if the MDI icon does not exist in the library.

Screenshots

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Copy link
Member

@jpelgrom jpelgrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

Based on a quick search, other places this could be useful:

  • Media player widget shows a source icon if set using MDI or mdi:cast otherwise, but assumes if there is an icon value it is valid
  • Wear OS entity chips show an icon, currently it actually handles null by not doing anything/keeping the placeholder (mdi:bookmark), use a domain icon or switch to showing nothing like the frontend?

@dshokouhi
Copy link
Member Author

Media player widget shows a source icon if set using MDI or mdi:cast otherwise, but assumes if there is an icon value it is valid

So for this we should probably default back to mdi:cast in case its null

  • Wear OS entity chips show an icon, currently it actually handles null by not doing anything/keeping the placeholder (mdi:bookmark), use a domain icon or switch to showing nothing like the frontend?

oh I didn't think it handled null based on

@jpelgrom
Copy link
Member

jpelgrom commented Oct 1, 2022

oh I didn't think it handled null based on (...)

Not there, but in Compose it is handled:

asset = iconBitmap ?: CommunityMaterial.Icon.cmd_bookmark,

@JBassett JBassett merged commit 48f2ca3 into home-assistant:master Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants