Kiosk mode: camera motion/presence detection for screen wake#4497
Open
nstefanelli wants to merge 12 commits intohome-assistant:mainfrom
Open
Kiosk mode: camera motion/presence detection for screen wake#4497nstefanelli wants to merge 12 commits intohome-assistant:mainfrom
nstefanelli wants to merge 12 commits intohome-assistant:mainfrom
Conversation
Adds 11 kiosk.camera.* keys covering motion detection, presence detection, face detection, sensitivity (low/medium/high), wake triggers, and footer copy. Regenerates SwiftGen output with updated Strings.swift accessors under L10n.Kiosk.Camera and L10n.Kiosk.Camera.Sensitivity.
…ings Adds MotionSensitivity enum (low/medium/high with threshold values) and 6 camera detection properties to KioskSettings: cameraMotionEnabled, cameraMotionSensitivity, wakeOnCameraMotion, cameraPresenceEnabled, cameraFaceDetectionEnabled, wakeOnCameraPresence. Replaces synthesized Codable with a custom init(from:) for backwards-compatible decoding so existing persisted settings without camera fields decode without error.
- Make processFrame/calculateDifference nonisolated in motion detector so CIFilter and CIContext.render run on processingQueue, not MainActor - Make processFrame nonisolated in presence detector so Vision requests run on processingQueue; settings read on MainActor then dispatched - Mark previousFrame, ciContext, and Vision requests as nonisolated(unsafe) since they are only accessed from their respective processing queues - Remove @published from errorMessage (internal debugging state, not UI) - Replace PR-specific comments in tests with neutral wording
Custom init(from:) suppresses the synthesized default initializer. Add explicit public init() so KioskSettings() continues to work.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4497 +/- ##
=======================================
Coverage ? 42.58%
=======================================
Files ? 274
Lines ? 16230
Branches ? 0
=======================================
Hits ? 6912
Misses ? 9318
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 camera-based motion and presence detection to kiosk mode (PR2 of kiosk series, per discussion #2403).
Builds on #4422 (PR1: core kiosk infrastructure).
Architecture
New files
Camera/KioskCameraDetectionManager.swiftCamera/KioskCameraMotionDetector.swiftCamera/KioskPresenceDetector.swiftKioskCameraDetection.test.swiftTest plan
Related