-
Notifications
You must be signed in to change notification settings - Fork 407
Feature: Kiosk Mode (2/7) - Core Manager & Integration #4198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Part 1 of Kiosk Mode implementation. This PR adds the foundation for Kiosk Mode: ## KioskSettings.swift - Complete settings model with all configuration options - Codable for persistence - Includes enums for screensaver modes, clock styles, photo sources, etc. - Entity trigger configurations - Dashboard rotation settings ## KioskConstants.swift - Centralized constants for animations, timing, notifications - Notification names for kiosk events ## Utilities - IconMapper: Converts MDI icons to SF Symbols - TouchFeedbackManager: Haptic and audio feedback - AnimationUtilities: Shared animation helpers These types form the foundation that subsequent PRs will build upon.
Part 2 of Kiosk Mode implementation. Depends on PR home-assistant#4197. ## KioskModeManager (~970 lines) Central coordinator for all kiosk functionality: - Enable/disable kiosk mode - Screen state management (on, dimmed, screensaver) - Brightness control with day/night scheduling - Idle timer and activity tracking - Dashboard navigation - Entity trigger subscriptions - HA WebSocket integration ## Security (~760 lines) - SecurityManager: PIN and biometric authentication - SettingsManager: Settings persistence ## Dashboard (~360 lines) - DashboardManager: Dashboard rotation and scheduling ## Camera Detection (~320 lines) - CameraDetectionManager: Motion and presence detection using front camera ## App Launcher (~360 lines) - AppLauncherManager: Launch external apps, return handling ## WebViewController Integration (~565 lines) - WebViewController+Kiosk: Kiosk overlay management - Modified WebViewController: Made properties internal for kiosk access
Part 3 of Kiosk Mode implementation. Depends on PRs home-assistant#4197 and home-assistant#4198. Adds screensaver functionality with multiple display modes: Files added (~52K): - ClockScreensaverView.swift: Clock display with multiple styles (large, minimal, digital, analog) - CustomURLScreensaverView.swift: Display custom HA dashboard as screensaver - EntityStateProvider.swift: Fetches and formats entity states for display - PhotoManager.swift: Manages photo loading from device, iCloud, and HA media - PhotoScreensaverView.swift: Photo slideshow with transitions - ScreensaverViewController.swift: UIKit controller coordinating screensaver presentation Features: - Multiple screensaver modes: clock, photos, dim, blank, custom URL - Clock styles: large, minimal, digital, analog with entity display - Photo sources: device albums, iCloud, Home Assistant media - Pixel shift for burn-in prevention - Day/night brightness scheduling
Part 4 of Kiosk Mode implementation. Depends on PRs home-assistant#4197, home-assistant#4198, home-assistant#4199. Adds navigation lockdown and overlay UI components: Files added (~39K): - EdgeProtectionView.swift: Invisible edge barriers preventing swipe gestures - QuickActionsView.swift: Quick launch panel for third-party apps - SecretExitGestureView.swift: Hidden gesture sequence to exit kiosk mode - StatusOverlayView.swift: Connection status, battery, and time display Features: - Edge protection blocks iOS system gestures (Control Center, notifications) - Configurable secret tap pattern for secure kiosk exit - Quick actions panel with app shortcuts - Status bar overlay with connection indicator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the core kiosk mode manager and integrates it with the existing Home Assistant iOS application's WebView infrastructure. It provides centralized coordination of kiosk functionality including screen state management, brightness control, dashboard rotation, entity triggers, camera detection, and external app launching.
Changes:
- Adds
KioskModeManageras the central coordinator for all kiosk mode functionality - Integrates kiosk mode controls into
WebViewControllervia extension - Implements supporting managers for security, settings, dashboards, camera detection, and app launching
- Introduces comprehensive settings model with persistence and synchronization capabilities
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
WebViewController.swift |
Modified access levels for kiosk integration; added status bar/home indicator logic for kiosk mode |
WebViewController+Kiosk.swift |
New extension integrating kiosk mode with WebViewController lifecycle and UI |
KioskModeManager.swift |
Core manager coordinating all kiosk functionality and state |
KioskSettings.swift |
Comprehensive settings model for kiosk configuration |
SecurityManager.swift |
Biometric/PIN authentication and remote lock management |
SettingsManager.swift |
Settings import/export and persistence handling |
DashboardManager.swift |
Dashboard rotation and scheduling logic |
CameraDetectionManager.swift |
Camera-based motion/presence detection coordinator |
AppLauncherManager.swift |
External app launching with return timeout tracking |
KioskConstants.swift |
Centralized constants for animations, timing, and UI dimensions |
TouchFeedbackManager.swift |
Haptic and sound feedback for touch interactions |
IconMapper.swift |
MDI to SF Symbol mapping utility |
AnimationUtilities.swift |
Reusable animation definitions and view modifiers |
HomeAssistant.xcodeproj/project.pbxproj |
Xcode project file updates for new source files |
Comments suppressed due to low confidence (1)
Sources/App/Kiosk/AppLauncher/AppLauncherManager.swift:1
- The code in
WebViewController+Kiosk.swiftline 409 referencesAudioManager.sharedwhich is not defined in the provided diffs. Verify this class exists in the codebase or is provided by PR #4197 (Foundation).
import Combine
- Replace custom PIN with device authentication (Face ID/Touch ID/Passcode) - Use LAPolicy.deviceOwnerAuthentication for flexible auth - Replace PINEntryView with simpler AuthenticationView - Rename isEnabled to isKioskModeEnabled for clarity
|
All review feedback has been addressed:
Ready for re-review. 🙏 |
Summary
Part 2 of 7 - Core kiosk mode manager and system integration.
This PR adds the central kiosk mode coordinator and integration with existing Home Assistant iOS components.
Files Added (~3,300 lines)
KioskModeManager.swiftSecurityManager.swiftSettingsManager.swiftDashboardManager.swiftCameraDetectionManager.swiftAppLauncherManager.swiftWebViewController+Kiosk.swiftKey Features
KioskModeManager: Singleton coordinator managing kiosk mode activation, screen brightness, idle timeout, entity subscriptions, and battery monitoring
SecurityManager: PIN/FaceID authentication with tamper detection
DashboardManager: Fetches available dashboards from Home Assistant, handles navigation
CameraDetectionManager: Motion and person detection using Vision framework for screen wake triggers
Test Plan
PR Series
🤖 Generated with Claude Code