Add kiosk screensaver sensor - #5063
Merged
Merged
Conversation
Add a "Kiosk Screensaver" binary sensor that reports whether the kiosk screensaver is currently visible: on while the screensaver is on screen, off otherwise. It follows the existing kiosk sensor pattern (mode, brightness, volume) and is enabled only while kiosk mode is enabled, on iOS/iPadOS. KioskModeManager now tracks screensaver visibility via isScreensaverVisible / screensaverVisiblePublisher, mirroring the existing camera-overlay handling. KioskScreensaverController forwards its isActive state into the manager so the sensor and its update signaler can report and react to changes. The sensor is also surfaced in the in-app kiosk sensors menu. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X19UpFyBKpRNaJAgXgqBUX
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new kiosk-related webhook binary sensor that reports whether the kiosk screensaver is currently visible, integrating with the existing kiosk sensor + update-signaler pattern and wiring visibility updates from the screensaver controller into KioskModeManager.
Changes:
- Introduces
kioskScreensaveras a newWebhookSensorIdand registers a newKioskScreensaverSensorprovider. - Tracks screensaver visibility in
KioskModeManagerviaisScreensaverVisible+screensaverVisiblePublisher, and drives updates fromKioskScreensaverController. - Surfaces the sensor in the in-app kiosk Sensors list and updates the
WebhookSensorIdcase-count test.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/App/Webhook/WebhookSensorIdTests.swift | Adds new ID assertion and updates the all-cases count check. |
| Sources/Shared/Environment/KioskModeManager.swift | Adds screensaver visibility state/publisher and includes the new sensor in kiosk-enabled gating. |
| Sources/Shared/Environment/Environment.swift | Registers the new KioskScreensaverSensor provider. |
| Sources/Shared/API/Webhook/WebhookSensorId.swift | Adds the kioskScreensaver enum case. |
| Sources/Shared/API/Webhook/Sensors/KioskScreensaverSensor.swift | Implements the new binary sensor + update signaler driven by screensaverVisiblePublisher. |
| Sources/App/Settings/Kiosk/KioskSensorsViewModel.swift | Adds the sensor ID to the kiosk Sensors menu ordering/filter list. |
| Sources/App/Settings/Kiosk/KioskScreensaverView.swift | Mirrors screensaver active state into Current.kiosk and resets visibility on teardown. |
7 tasks
bgoncal
added a commit
that referenced
this pull request
Jul 22, 2026
bgoncal
added a commit
that referenced
this pull request
Jul 22, 2026
The cherry-pick added the file on disk but not to the project. On main the Shared sources are an SPM/synced folder so no project entry is needed; 2026.7.x uses explicit pbxproj membership, so the new sensor must be added to the Shared-iOS and Shared-watchOS targets (mirroring the sibling Kiosk sensors). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new Kiosk Screensaver binary sensor, alongside the existing kiosk sensors (Kiosk Mode, Kiosk Brightness, Kiosk Volume). It reports whether the kiosk screensaver is currently on screen:
Details:
KioskModeManagernow tracks screensaver visibility viaisScreensaverVisibleand ascreensaverVisiblePublisher, mirroring the existing camera-overlay handling.KioskScreensaverControllerforwards itsisActivestate into the shared manager (and resets it on teardown) so the sensor and its update signaler can report and react to changes in real time.SensorProvider+SensorProviderUpdateSignaler), is abinary_sensor, and is iOS/iPadOS only.mdi:sleepwhen on,mdi:sleep-offwhen off.Screenshots
N/A — this adds a webhook sensor; no new user-facing screen. The sensor appears in the existing kiosk Sensors settings list.
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
WebhookSensorIdgains akioskScreensavercase; the existingWebhookSensorIdTestscase-count assertion was updated accordingly.🤖 Generated with Claude Code
https://claude.ai/code/session_01X19UpFyBKpRNaJAgXgqBUX
Generated by Claude Code