Skip to content

Add "Assist prompt" option for CarPlay quick access#4619

Open
bgoncal wants to merge 1 commit into
mainfrom
carplay-assost-prompt
Open

Add "Assist prompt" option for CarPlay quick access#4619
bgoncal wants to merge 1 commit into
mainfrom
carplay-assost-prompt

Conversation

@bgoncal
Copy link
Copy Markdown
Member

@bgoncal bgoncal commented May 8, 2026

Summary

Adds option for the user to add buttons (Assist prompts) in CarPlay Quick Access tab where when pressed sends a pre-defined prompt for the chosen Assist pipeline, gets processed and returns audio response.

Avoid recurrently asking the same to Assist in CarPlay

  • Example/Prompt 1: "Did I leave any of my doors open?" (The alternative would be checking each door in entity cards, the Assist prompt provides a quick single response)

  • Example/Prompt 2: "If my partner is home, announce in the rooms that are occupied that I am arriving home soon" (The alternative would be the user sending a message to their partner using siri or similar approach)

Screenshots

Link to pull request in Documentation repository

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

Any other notes

@bgoncal bgoncal self-assigned this May 8, 2026
Copilot AI review requested due to automatic review settings May 8, 2026 18:26
@bgoncal bgoncal added the assist label May 8, 2026
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

Adds a new “Assist prompt” Magic Item type to CarPlay Quick Access, allowing users to create buttons that send predefined text prompts to an Assist pipeline and play back the audio response, reducing repetitive manual Assist interactions while driving.

Changes:

  • Introduces MagicItem.ItemType.assistPrompt with persisted fields (assistPrompt, assistPipelineId) and updates shared providers/migrations to support it.
  • Adds iOS Settings UI to create/edit Assist prompt items and wires them into CarPlay Quick Access rendering and session launching.
  • Extends CarPlayAssistSession to optionally start by sending a text prompt (instead of recording audio), while keeping existing voice pipeline behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Sources/Watch/WatchCommunicatorService.swift Treats assist items as unsupported on Watch (includes new assistPrompt type).
Sources/Shared/Resources/Swiftgen/Strings.swift Adds SwiftGen-accessible localized strings for Assist prompt and unsupported Assist labels.
Sources/Shared/MagicItem/MagicItemProvider.swift Resolves display info for assistPrompt and normalizes CarPlay assist items (colors/confirmation).
Sources/Shared/MagicItem/MagicItem+Migration.swift Excludes assistPrompt from entity-based migration logic.
Sources/Shared/MagicItem/MagicItem.swift Adds new item type and persisted fields for Assist prompt.
Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessViewModel.swift Filters assist items based on iOS availability (26.4+).
Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift Displays assistPrompt in Quick Access lists and launches assist sessions with optional prompt.
Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift Adds optional prompt flow (text Assist) and restart behavior for prompt vs recording sessions.
Sources/App/Settings/MagicItem/Add/AssistPromptMagicItemView.swift New SwiftUI screen to add/edit Assist prompt items.
Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift Adds Assist prompt entry to the CarPlay Quick Access configuration UI and supports editing prompts.
Sources/App/Settings/AppIconShortcuts/AppIconShortcutItemsUpdater.swift Updates icon mapping to include assistPrompt.
Sources/App/Resources/en.lproj/Localizable.strings Adds English strings for Assist prompt UI and unsupported Assist labels.
HomeAssistant.xcodeproj/project.pbxproj Registers the new Swift file and includes Xcode project bookkeeping changes.

Comment on lines +172 to +175
Image(uiImage: MaterialDesignIcons.messageProcessingOutlineIcon.image(
ofSize: .init(width: 18, height: 18),
color: .label
))
Comment on lines 57 to 58
let retryButton = CPButton(
image: makeActionButtonImage(icon: .microphoneIcon, color: .haPrimary)
Comment on lines 577 to 582
let session = CarPlayAssistSession(
interfaceController: interfaceController,
server: server,
pipelineId: magicItem.id
pipelineId: magicItem.assistPipelineId ?? magicItem.id,
prompt: magicItem.type == .assistPrompt ? magicItem.assistPrompt : nil
)
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@45e05e6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
Sources/Shared/MagicItem/MagicItem.swift 20.00% 8 Missing ⚠️
Sources/Shared/MagicItem/MagicItem+Migration.swift 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4619   +/-   ##
=======================================
  Coverage        ?   43.95%           
=======================================
  Files           ?      280           
  Lines           ?    17013           
  Branches        ?        0           
=======================================
  Hits            ?     7478           
  Misses          ?     9535           
  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.

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