## Summary
- Add DebugSwift as a Swift Package dependency pinned through
`Package.resolved` at 1.15.0
- Link the DebugSwift product to the App target
- Initialize DebugSwift during app launch for Debug builds only
## Summary
- fix oversized native status-bar spacing on iOS 15 by sizing the spacer
from the window scene status bar frame
- provide app-owned CSS safe-area variables to the frontend on iOS
versions prior to 16
- refresh the legacy safe-area values after layout changes, settings
changes, view appearance, and page loads
## Root cause
Issues #4499 and #4631 point to iOS 15 devices reporting inflated
safe-area values after recent WebView/status-bar changes. The frontend
then consumes those values through safe-area CSS variables, and in the
iPad report the native WebView is also laid out below an oversized
status-bar spacer.
## Summary
- normalize manually entered server URLs by stripping path, query, and
fragment while preserving port and authority
- use the normalized base URL for onboarding auth and for the stored
manual server URL
- add tests covering auth URL construction, discovered manual URLs, and
the shared URL helper
## Root cause
Manual onboarding appended /auth/authorize to the full user-entered URL.
If the user entered a frontend route like /lovelace/0, the auth flow
loaded /lovelace/0/auth/authorize and never reached the expected
callback.
## Summary
Custom widget AppIntents
(`CustomWidgetToggle/Activate/PressButton/UpdateWidgetItemConfirmationStateAppIntent`)
used a single combined `guard` block with a silent `return .result()` on
failure. When a tap bailed out — wrong domain, missing parameters,
server lookup miss, no active URL — nothing was logged anywhere, which
made user reports like
[#4488](https://github.com/home-assistant/iOS/issues/4488) ("widget taps
do nothing on iOS 26.4+") impossible to triage.
Changes:
- Split each guard into separate checks with an `Current.Log.error(...)`
line per failure mode, so the widget-extension log now shows *which*
precondition failed.
- Extract the server/connection lookup into a small
`CustomWidgetIntentHelper.resolveConnection` so the three intents don't
duplicate the same boilerplate.
- When `Current.api(for: server)` returns nil (i.e. `activeURL()` is nil
— server unreachable from this network), dispatch a local notification
("Home Assistant could not be reached…") so the tap no longer silently
does nothing.
No behavior change for the success path. Failure paths still `return
.result()` — they just now leave evidence behind.
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
Before forwarding unknown tags to Home Assistant, present a confirmation
dialog.
Android implementation:
https://github.com/home-assistant/android/pull/6814
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="966" height="1004" alt="CleanShot 2026-05-07 at 15 56 54@2x"
src="https://github.com/user-attachments/assets/b7411e42-c2ec-473b-8241-c3280531737f"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
Fixes mTLS client certificate sharing across multiple servers when the
same .p12 / SecIdentity is assigned to more than one server.
- Store imported client certificate identities using a stable SHA-256
fingerprint of the leaf certificate instead of a server-specific
identifier.
- Update duplicate Keychain identity handling so re-importing the same
certificate migrates the existing item to the stable fingerprint-based
label.
- Avoid deleting a shared Keychain identity when removing or replacing a
certificate on one server if another configured server still references
it.
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
The issue is the new WebView bridge origin check. It compares configured
URL hosts with WKSecurityOrigin.host and IPv6 can appear as fd00::abcd
in one API and [fd00::abcd] in another, so the bridge rejects valid
frontend messages. That blocks external auth and leaves the frontend
loading, while widgets still work.
This PR normalizes the url
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
As part of removing legacy iOS actions from the app completely, this PR
adds a way for the user to choose what to display in app icon long press
menu.
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="3216" height="1890" alt="CleanShot 2026-04-30 at 11 35
28@2x"
src="https://github.com/user-attachments/assets/4680d7e4-4790-4f21-b4b4-b93f641ce769"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Summary
Four pieces of dead code with zero inbound references in `Sources/` or
`Tests/`. Verified by `git grep` against `origin/main` after PRs
#4561–#4564 + #4576 landed.
| Item | Lines | Status |
|---|---|---|
| `Sources/App/Utilities/ScaledFont.swift` | 115 | Third-party Keith
Harrison dynamic-type utility, never referenced |
| `Sources/App/Utilities/VoiceShortcutsManager.swift` | 35 | `public
class` wrapping `INVoiceShortcut` lookup, never instantiated |
| `Sources/App/Utilities/InputAccessoryView.swift` | 37 | Custom
`UIView` subclass, never instantiated, no XIB/storyboard `customClass`
reference |
| `EntitiesStateSubscription` protocol in
`Sources/App/Scenes/CarPlaySceneDelegate.swift` | 5 | Declares
`subscribe()`/`unsubscribe()` with no conformers and no callers |
**204 lines deleted across 5 files** (3 source deletions, 1 partial
edit, 1 `project.pbxproj` cleanup). No behavior change.
## Verification
- `git grep` for each type name across `Sources/` and `Tests/` returns
only the file itself + the `project.pbxproj` entry.
- Searched for indirect references: XIB `customClass="X"`,
`NSStringFromClass`, `@objc` selectors, string-based UIKit nib loaders.
None found.
- `plutil -lint` confirms `project.pbxproj` parses.
- `swiftformat` + `rubocop -a` produce zero changes.
## Test plan
- [ ] CI build + tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
Now that PRs #4560–#4564 have migrated every Eureka-based settings
screen to SwiftUI, every remaining Eureka file on `main` is dead code.
This PR removes them, the Eureka pod, and the two Eureka-community
add-on pods.
**Reachability check before deleting:**
- `SettingsRootDataSource.swift` (the legacy Eureka settings root) has
zero inbound references. The active settings root is
`SettingsItem.swift`, which already routes to SwiftUI views
(`NFCListView()`, `ComplicationListView()`, etc.).
- The legacy `*ViewController.swift` files (`NFCListViewController`,
`ComplicationListViewController`, `SettingsDetailViewController`, etc.)
are reachable only from `SettingsRootDataSource` and from each other.
- The Eureka helper-row library (`Sources/App/Settings/Eureka/`) is used
only by those legacy view controllers.
- A handful of doc-comment mentions in active SwiftUI code (e.g. `//
SwiftUI replacement for ButtonRowWithLoading`) are not real references.
- Tests don't import Eureka. `ColorPickerRow` and `ViewRow` (Eureka
community pods) aren't referenced anywhere.
## What's removed
- `Sources/App/Settings/Eureka/` — 14 files (`HAFormViewController`,
helper rows, `AccountInitialsImage`)
- `Sources/App/Settings/MaterialDesignIcons+Eureka.swift` — `SearchItem`
conformance for the now-deleted `SearchPushRow`
- `Sources/App/Settings/SettingsRootDataSource.swift`
- `Sources/App/Settings/Settings/SettingsDetailViewController.swift`
-
`Sources/App/Settings/AppleWatch/Complication{List,FamilySelect,Edit}ViewController.swift`
- `Sources/App/Settings/NFC/NFC{List,Tag}ViewController.swift`
- `Sources/App/Utilities/{SearchPushRow,WebSocketStatusRow}.swift`
- `Eureka`, `ColorPickerRow`, `ViewRow` pods (Podfile + Podfile.lock)
- `import Eureka` from `SettingsSceneDelegate.swift`
- `-framework "Eureka"` from inlined `OTHER_LDFLAGS` in
`project.pbxproj`
24 files deleted, 4 modified. Pure dead-code removal — no behavior
changes.
## Stacked on #4563
This PR targets `claude/eureka-notification-categories-swiftui` (PR
#4563). After #4563 merges, GitHub will auto-rebase the base to `main`.
## Test plan
- [ ] CI lint + test passes
- [ ] Build succeeds with the smaller pod set
- [ ] Manual smoke test: open Settings → NFC, Settings → Complications,
Notifications → Categories — all SwiftUI screens still functional
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
Migrate the notification category list and the category/action editors
to SwiftUI:
- `NotificationCategoryListView`: local insert/delete, Realm-observed
server categories section, navigation to editor.
- `NotificationCategoryEditorView`: required fields, server-controlled
read-only mode, hidden preview/summary text areas, reorder/insert/delete
action rows, YAML service-call preview, toolbar help,
preview-notification action.
- `NotificationActionEditorView`: required title/identifier, conditional
text-input fields, foreground/destructive/authentication toggles,
server-controlled read-only mode, YAML trigger preview.
Also adds three reusable components:
- `YamlPreviewSection` — replaces Eureka `YamlSection` within this
slice; generalises the inline version previously in `NFCTagView`.
- `NotificationIdentifierField` — SwiftUI text-field helper enforcing
identifier casing/validation (replaces
`NotificationIdentifierEurekaRow`).
- `RealmResultsObserver` — `ObservableObject` wrapping
`AnyRealmCollection` with a notification token (reusable by future
slices).
Deletes the three old `*Configurator.swift` / `*ViewController.swift`
files plus `NotificationIdentifierEurekaRow.swift`.
## Screenshots
_Pending — to be added before merge._
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
Part of a five-PR Eureka → SwiftUI migration tracked in
`UIKitToSwiftUIMigration.md` (siblings: #4560, #4561, #4562, #4564). The
`Eureka`, `ColorPickerRow`, and `ViewRow` pods stay until all slices
land.
**Reconciliation with #4562:** this PR embeds
`NotificationCategoryListView` inside the old
`NotificationSettingsViewController` via `UIHostingController` so the
list is reachable while the parent screen is still Eureka. Once #4562
merges, `NotificationSettingsView` should link directly to
`NotificationCategoryListView` — the hosting-controller wrapper becomes
unnecessary.
`YamlSection.swift` and `RealmSection.swift` are retained — still used
by `ActionConfigurator`, `NFCTagViewController`,
`SettingsDetailViewController`, and `ComplicationListViewController`.
`bundle exec fastlane lint` passes. Not build-verified locally yet.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Summary
`Sources/App/Settings/HomeAssistantLogoView.xib` is dead — the XIB
declares a custom view class `HomeAssistantLogoView` from the
`HomeAssistant` module, but:
- No `HomeAssistantLogoView.swift` exists anywhere in the project
- Nothing loads the nib (no `UINib(nibName: "HomeAssistantLogoView"`, no
`Bundle.loadNibNamed("HomeAssistantLogoView"`)
- The only references to the name are the XIB file itself and its
`project.pbxproj` entries
Removes the XIB and its 4 `project.pbxproj` references.
## Test plan
- [ ] Build still succeeds
- [ ] No visual regressions in Settings (screen never rendered this XIB
anyway)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
Migrate the notification settings screen and its three leaf screens to
SwiftUI:
- `NotificationSettingsView`: permission status, learn-more link, sounds
/ categories / rate-limit / debug navigation, badge reset + auto-clear,
push ID share, push ID reset.
- `NotificationSoundsView`: imported / bundled / system segmented lists,
audio playback, swipe delete, `.fileImporter`, file-sharing + system
import, AKConverter progress HUD, alert handling.
- `NotificationRateLimitView`: pull-to-refresh on iOS, toolbar refresh
on Catalyst, 1-second reset countdown, retry state, parent
remaining-count callback.
- `NotificationDebugNotificationsView`: `UserDefaults`-backed toggles.
Removes the Eureka `row(for:)` extensions in
`NotificationRateLimitsAPI.swift`, deletes the four old
`*ViewController.swift` files, and rewires `SettingsItem.notifications`
and `NotificationManager.openSettingsFor` to the SwiftUI view.
## Screenshots
_Pending — to be added before merge._
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
Part of a five-PR Eureka → SwiftUI migration tracked in
`UIKitToSwiftUIMigration.md` (siblings: #4560, #4561, #4563, #4564). The
`Eureka`, `ColorPickerRow`, and `ViewRow` pods stay until all slices
land.
**Reconciliation with #4563:** the categories PR temporarily embeds
`NotificationCategoryListView` inside the old
`NotificationSettingsViewController` via `UIHostingController`. This PR
deletes that controller entirely; after both merge, the
`categoriesDestination` in `NotificationSettingsView` should link
directly to `NotificationCategoryListView` from the categories PR.
`bundle exec fastlane lint` passes. Not build-verified locally yet.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Summary
Replace the Eureka actions list with `ActionsSettingsView` +
`ActionsSettingsViewModel` (value-type Realm snapshots, delete/reorder,
scene toggle + customize flow, server refresh). Replace
`ActionConfigurator` with `ActionConfiguratorView` using SwiftUI `Form`,
`IconPicker`, SwiftUI `ColorPicker`, the existing
`WidgetBasicButtonView` preview, and a new inline `ActionServerPicker`.
`SettingsItem.actions` is wired directly to the SwiftUI view and the
Eureka actions code is removed from `SettingsDetailViewController`.
## Screenshots
_Pending — to be added before merge._
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
Part of a five-PR Eureka → SwiftUI migration tracked in
`UIKitToSwiftUIMigration.md` (siblings: #4560, #4562, #4563, #4564). The
`Eureka`, `ColorPickerRow`, and `ViewRow` pods stay until all slices
land.
`ServerSelectRow.swift` is intentionally kept in-tree because
`ComplicationEditViewController` still uses it — both come out once the
complications slice (#4564) merges.
Not build-verified locally yet; may surface access-level fixes (e.g.
internal synthesized initializers on Shared types) during build.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Summary
iPad has supported Live Activities since iPadOS 17 — the previous
`userInterfaceIdiom == .pad` guard in `LiveActivitySettingsView` was
incorrect. `areActivitiesEnabled` (the `ActivityAuthorizationInfo` API)
already returns the correct value on iPad, so no platform-specific gate
is needed.
Changes:
- Remove the `userInterfaceIdiom == .pad` branch from
`LiveActivitySettingsView` that showed a static "Not available on iPad"
label. iPad users now see the same enabled/open-settings states as
iPhone.
- Drop the `live_activity.status.not_supported` localisation key from
all 34 locale files and the generated `Strings.swift` accessor.
- Update a stale comment in `HAAPI.swift` that incorrectly stated iPads
report `false` for `areActivitiesEnabled`.
ActivityKit handles Dynamic Island availability transparently — the
island pill appears on iPhone 14 Pro/Pro Max and all iPhone 15 and later
models; on iPad and older iPhones it simply doesn't render, and the
activity shows on the Lock Screen only.
## References
- Apple docs confirming iPad support: [Displaying live data with Live
Activities](https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities)
- Companion docs PR: home-assistant/companion.home-assistant#1303
## Test plan
- [ ] On iPhone: Live Activities settings screen shows
enabled/open-settings as before
- [ ] On iPad (iPadOS 17+): settings screen no longer shows "Not
available on iPad"; shows enabled/open-settings
- [ ] On iPad (iPadOS 17+): Live Activities can be started and updated
from Home Assistant
- [ ] On iPad (iPadOS 16 or earlier): `areActivitiesEnabled` returns
`false`; open-settings button shown
- [ ] Verify `live_activity.status.not_supported` key is absent from all
`.lproj` files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
## Summary
Replace the Eureka-based location settings screen with a SwiftUI
`LocationSettingsView` + `LocationSettingsViewModel`. Includes
permission status rows, background refresh, location history link,
manual location update, update-source toggles, and per-zone read-only
sections. Zone detail now uses an `MKMapView`-backed SwiftUI preview
with the zone radius overlay. `PermissionStatusRow.swift` and
`EurekaLocationRow.swift` are removed; permission/disabled-state logic
moves into the view model. `SettingsItem.location` is routed directly to
the SwiftUI view and the location setup (~270 lines) is trimmed from
`SettingsDetailViewController`.
## Screenshots
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
Part of a five-PR Eureka → SwiftUI migration tracked in
`UIKitToSwiftUIMigration.md`. The `Eureka`, `ColorPickerRow`, and
`ViewRow` pods stay until the remaining four slices land: actions
(#4561), notification settings (#4562), notification categories (#4563),
watch complications (#4564).
Build-verified locally on iOS simulator.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
## Summary
Fixes#4506.
When kiosk mode's screensaver dims `UIScreen.main.brightness` (or when
the managed-brightness setting is active) and the user taps a push
notification to open another app, the dim would persist system-wide — HA
only restored brightness when re-entering kiosk mode. Only re-opening HA
would bring it back.
This PR restores the user's original brightness (captured in
`enableKioskMode()`) when HA backgrounds, and re-applies the kiosk
brightness state when HA returns to foreground.
**Deliberate choice:** wired to
`UIApplication.didEnterBackgroundNotification`, **not**
`willResignActiveNotification`. This means a notification banner
dropping down, Control Center pulldown, or incoming-call alert alone
does NOT undo the kiosk dim — only actually leaving the app does.
Matches what users expect from a kiosk: the display stays dim unless
someone truly uses the device elsewhere.
## Behavior matrix
| Event | Kiosk state | Result |
|---|---|---|
| Notification banner drops (no app switch) | on + screensaver dim |
Stays dimmed |
| Tap notification → other app opens | on + screensaver dim | Restored
to pre-kiosk brightness |
| Tap notification → other app opens | on + ` brightnessControlEnabled `
| Restored to pre-kiosk brightness |
| Return to HA | on + screensaver still active | Re-dims |
| Return to HA | on + ` brightnessControlEnabled ` | Re-applies managed
level |
| Device locks/sleeps | on | Restored to pre-kiosk brightness |
## Implementation
Single file change in `Sources/App/Kiosk/KioskModeManager.swift`:
- ` appDidEnterBackground() ` — restore ` originalBrightness ` when
kiosk active
- ` appDidBecomeActive() ` — re-apply screensaver dim OR managed
brightness on return (depending on current state)
- Extracted ` applyBrightnessForActiveScreensaver() ` helper from `
showScreensaver() ` so foreground-reapply and initial-show share one
code path (DRY)
No new settings, no UI changes, no API additions, no unrelated file
touches.
## Tests
New file ` Tests/App/Kiosk/KioskLifecycleBrightness.test.swift ` (Swift
Testing, per project convention):
- ` backgroundRestoresOriginalBrightnessWhenScreensaverActive `
- ` foregroundReappliesScreensaverDim `
- ` foregroundReappliesManagedBrightnessWithoutScreensaver `
- ` lifecycleDoesNothingWhenKioskInactive `
Tests drive ` KioskModeManager.shared ` directly (there is no injectable
instance today). The setup helper snapshots ` Current.screenBrightness `
/ ` setScreenBrightness ` closures AND persisted kiosk settings, then
restores both on cleanup — so runs do not pollute the GRDB database or
leak state between tests.
## Follow-up candidate (not this PR)
If maintainers prefer, ` KioskModeManager ` could grow an injectable
initializer to allow testing without touching the shared singleton. I
did not do that here to keep the PR focused on the fix, but happy to
send a separate PR if you'd like that refactor.
## Test plan
- [x] Unit tests pass (` KioskLifecycleBrightnessTests ` — 4 cases)
- [x] Existing kiosk tests still pass (no regression from the `
showScreensaver() ` refactor)
- [x] ` bundle exec fastlane lint ` clean (SwiftFormat + SwiftLint +
Rubocop)
- [x] ` xcodebuild ` clean build (App target)
- [x] ` xcodebuild build-for-testing ` (test bundle compiles)
---------
Co-authored-by: Nick Stefanelli <nstefanelli@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="774" height="1350" alt="CleanShot 2026-04-24 at 16 23 54@2x"
src="https://github.com/user-attachments/assets/e154ae63-48ff-4c47-a0ae-ae761fc40f9c"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="3248" height="1968" alt="CleanShot 2026-04-24 at 16 02
41@2x"
src="https://github.com/user-attachments/assets/d82f36fd-64af-4568-82df-e6f9d0e0a9d9"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="996" height="1508" alt="CleanShot 2026-04-24 at 14 38 13@2x"
src="https://github.com/user-attachments/assets/583c45c7-a4a6-4dda-92e9-bcee8fc04953"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="1206" height="2622" alt="Simulator Screenshot - Daily tester
2 - 2026-04-22 at 15 58 29"
src="https://github.com/user-attachments/assets/1ecea252-be42-44c6-a3c3-9bd28efc57dd"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="1206" height="2622" alt="Simulator Screenshot - Daily tester
2 - 2026-04-22 at 14 43 08"
src="https://github.com/user-attachments/assets/66e0e557-5b69-4f8d-82c1-53dbf7fb4b9b"
/>
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
Avoid passing an explicit empty passphrase to SecPKCS12Import on macOS
by introducing ClientCertificateManager.pkcs12ImportOptions(password:).
importP12 now uses this helper so an empty password results in no
passphrase option being supplied. Added unit tests verifying both empty
and non-empty password behavior and imported Security in the test file.
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
https://github.com/user-attachments/assets/e6c5eecb-4399-4e44-94e8-dc0b5ed8d744
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->