Skip to content

Fix missing icons for CarPlay controls#4464

Merged
bgoncal merged 2 commits intomainfrom
carplay-icons
Mar 31, 2026
Merged

Fix missing icons for CarPlay controls#4464
bgoncal merged 2 commits intomainfrom
carplay-icons

Conversation

@bgoncal
Copy link
Copy Markdown
Member

@bgoncal bgoncal commented Mar 31, 2026

Summary

Screenshots

Link to pull request in Documentation repository

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

Any other notes

@bgoncal bgoncal self-assigned this Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 10:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CarPlay entity icon rendering by ensuring HAEntity.getIcon() uses the resolved Material Design Icon (custom attribute icon or domain-based fallback) instead of always returning the default bookmark icon, and adds regression tests for the expected fallback behavior.

Changes:

  • Update HAEntity.getIcon() to use getMDI() as the base icon source.
  • Add unit tests verifying CarPlay icon selection for (a) no custom icon and (b) custom attributes.icon present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Tests/Shared/HAEntityCarPlay.test.swift Adds regression tests covering CarPlay icon fallback and custom icon preservation.
Sources/Shared/HAEntity+CarPlay.swift Fixes icon selection by using getMDI() output rather than an unconditional default icon.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@e513027). Learn more about missing BASE report.

Files with missing lines Patch % Lines
Sources/Shared/HAEntity+CarPlay.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4464   +/-   ##
=======================================
  Coverage        ?   42.51%           
=======================================
  Files           ?      267           
  Lines           ?    15650           
  Branches        ?        0           
=======================================
  Hits            ?     6654           
  Misses          ?     8996           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bgoncal bgoncal merged commit 507c93f into main Mar 31, 2026
15 checks passed
@bgoncal bgoncal deleted the carplay-icons branch March 31, 2026 11:43
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.

2 participants