Skip to content

Add kiosk screensaver sensor - #5063

Merged
bgoncal merged 1 commit into
mainfrom
claude/kiosk-screensaver-sensor-t1l38w
Jul 12, 2026
Merged

Add kiosk screensaver sensor#5063
bgoncal merged 1 commit into
mainfrom
claude/kiosk-screensaver-sensor-t1l38w

Conversation

@bgoncal

@bgoncal bgoncal commented Jul 12, 2026

Copy link
Copy Markdown
Member

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:

  • On while the screensaver is visible
  • Off when the screensaver is not on screen

Details:

  • KioskModeManager now tracks screensaver visibility via isScreensaverVisible and a screensaverVisiblePublisher, mirroring the existing camera-overlay handling.
  • KioskScreensaverController forwards its isActive state 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.
  • The sensor follows the established kiosk sensor pattern (SensorProvider + SensorProviderUpdateSignaler), is a binary_sensor, and is iOS/iPadOS only.
  • Like the brightness and volume kiosk sensors, it is automatically enabled only while kiosk mode is enabled.
  • It is also surfaced in the in-app kiosk Sensors settings menu.
  • Icon: mdi:sleep when on, mdi:sleep-off when 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

WebhookSensorId gains a kioskScreensaver case; the existing WebhookSensorIdTests case-count assertion was updated accordingly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X19UpFyBKpRNaJAgXgqBUX


Generated by Claude Code

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
Copilot AI review requested due to automatic review settings July 12, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 kioskScreensaver as a new WebhookSensorId and registers a new KioskScreensaverSensor provider.
  • Tracks screensaver visibility in KioskModeManager via isScreensaverVisible + screensaverVisiblePublisher, and drives updates from KioskScreensaverController.
  • Surfaces the sensor in the in-app kiosk Sensors list and updates the WebhookSensorId case-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.

@bgoncal
bgoncal merged commit c6cfc8d into main Jul 12, 2026
12 checks passed
@bgoncal
bgoncal deleted the claude/kiosk-screensaver-sensor-t1l38w branch July 12, 2026 21:40
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants