Skip to content

Accept notification_icon_color as preferred alias to color - #7091

Merged
TimoPtr merged 3 commits into
home-assistant:mainfrom
inukiwi:notification_icon_color
Jun 29, 2026
Merged

Accept notification_icon_color as preferred alias to color#7091
TimoPtr merged 3 commits into
home-assistant:mainfrom
inukiwi:notification_icon_color

Conversation

@inukiwi

@inukiwi inukiwi commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Accept notification_icon_color as preferred alias to color in notification data.
The iOS app now uses notification_icon_color to specify the notification icon color, as color is not preferred due to other color attributes existing too.

This change supports the notification_icon_color parameter alongside the old color parameter.
If both parameters are present, color will be ignored.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Any other notes

Requires update to Firebase Cloud Messaging to support the new key on Android. home-assistant/mobile-apps-fcm-push#328

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Android companion app’s notification handling to accept a new notification payload key, notification_icon_color, as the preferred alias for the existing color key. This aligns Android with the iOS app payload format while maintaining backward compatibility.

Changes:

  • Prefer notification_icon_color over color when setting NotificationCompat.Builder.color
  • Preserve existing behavior by falling back to color when the new key is absent

@TimoPtr

TimoPtr commented Jun 25, 2026

Copy link
Copy Markdown
Member

Could you add a link to the documentation that updates this too?

@jpelgrom

Copy link
Copy Markdown
Member

I think it would also be nice to have this string as a const like message at the top.

@inukiwi

inukiwi commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@TimoPtr PR for documentation: home-assistant/companion.home-assistant#1362

@jpelgrom I've moved notification_icon_color to a const, I'm assuming you didn't mean the same for color right?

@jpelgrom

Copy link
Copy Markdown
Member

@jpelgrom I've moved notification_icon_color to a const, I'm assuming you didn't mean the same for color right?

I didn't mean the same for color but now that you mention it I would also do that one :) We try to use constants when adding something or changing things so now would be the time.

@TimoPtr
TimoPtr enabled auto-merge (squash) June 29, 2026 12:55
@TimoPtr
TimoPtr disabled auto-merge June 29, 2026 13:44
@TimoPtr
TimoPtr merged commit f28f36d into home-assistant:main Jun 29, 2026
18 of 19 checks passed
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