Fine tuning Live Activity implementation#4696
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fine-tunes the Live Activity implementation by extending the Live Activity content model to support a dynamically updateable title, and by reporting a per-activity push token expiration timestamp back to Home Assistant core.
Changes:
- Add
titletoHALiveActivityAttributes.ContentStateand plumb it through notification payload parsing and Live Activity UI rendering. - Extend the per-activity push token webhook payload with an
expires_atfield and freeze the TTL contract in tests. - Add a DEBUG-only switch to optionally disable local push handling during Live Activity testing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Shared/LiveActivity/LiveActivityContractTests.swift | Updates wire-format contract tests for new title key and expires_at/TTL assertions. |
| Tests/Shared/LiveActivity/HandlerLiveActivityTests.swift | Extends handler tests to validate parsing of the new title field. |
| Sources/Shared/Notifications/NotificationCommands/HandlerLiveActivity.swift | Parses title into the dynamic Live Activity content state. |
| Sources/Shared/LiveActivity/LiveActivityRegistry.swift | Adds expires_at reporting for push tokens and defines TTL contract constant. |
| Sources/Shared/LiveActivity/HALiveActivityAttributes.swift | Adds title to ContentState with explicit CodingKeys + Codable support. |
| Sources/Extensions/Widgets/LiveActivity/HALockScreenView.swift | Uses dynamic state.title when present, falling back to attributes title. |
| Sources/Extensions/Widgets/LiveActivity/HADynamicIslandView.swift | Uses dynamic state.title when present, falling back to attributes title. |
| Sources/App/Notifications/NotificationManager.swift | Adds DEBUG-only toggle to force-disallow local push interface for testing. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4696 +/- ##
=======================================
Coverage ? 44.86%
=======================================
Files ? 275
Lines ? 16754
Branches ? 0
=======================================
Hits ? 7517
Misses ? 9237
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Found 21 unused localization strings in the codebase. Click to see detailsTo clean up these strings, manually remove them from the |
) Brings the Live Activity settings redesign and DEBUG samples from #4554 into the #4696 fine-tuning branch. Conflict resolutions: - DebugView: drop the Live Activity debug link (moved to root Settings by #4554), keep #4696/main's carPlayDebugSection. - SettingsItem: keep #4554's array-based macCatalyst hidden-items filter and add main's newer .appIconShortcuts to it. - LiveActivitySettingsView: keep #4554's isLiveActivitySupportedOnDevice guard in the status section. - Restore live_activity.status.not_supported in en.lproj + Strings.swift (main had removed it; #4554's redesigned view references it). - Locale strings (hu/ko-KR/ru/sv): keep main's translations, drop the removed footer/privacy.message/section.privacy keys (consistent with the other auto-merged locales). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve ja/ko-KR Localizable.strings conflicts introduced by integrating #4554: keep main's latest translations, drop the Live Activity keys removed by #4554 (frequent_updates.footer, privacy.message, section.privacy), consistent with the other locales. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
expires_at.expires_atto whole-second epoch values to keep the webhook contract stable and avoid fractional timestamp inconsistencies.live_activity_token) to keep the test contract consistent with production behavior.Screenshots
N/A (no user-facing UI changes in this follow-up adjustment)
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
CC @rwarner