Skip to content

Conversation

@nstefanelli
Copy link

Summary

Part 3 of 7 - Screensaver display modes and photo management.

⚠️ Depends on: PR #4197 (Foundation) and PR #4198 (Core Manager)

Reviewers: This PR adds ~1,700 lines. To see only this PR's changes:

git fetch https://github.com/nstefanelli/ha-kiosk.git kiosk-2-manager kiosk-3-screensaver
git diff FETCH_HEAD~1..FETCH_HEAD

Files Added (~1,700 lines)

File Lines Purpose
ClockScreensaverView.swift ~330 Clock display with multiple styles
CustomURLScreensaverView.swift ~220 Display custom HA dashboard as screensaver
EntityStateProvider.swift ~170 Fetches and formats entity states
PhotoManager.swift ~410 Photo loading from device/iCloud/HA media
PhotoScreensaverView.swift ~270 Photo slideshow with transitions
ScreensaverViewController.swift ~310 UIKit controller for screensaver presentation

Screensaver Modes

Mode Description
Clock Large clock with optional date, seconds, entity values
Clock + Entities Clock with Home Assistant entity state display
Photos Slideshow from device, iCloud, or HA media
Photos + Clock Photo slideshow with clock overlay
Dim Blank dimmed screen
Blank Completely black screen
Custom URL Load a custom HA dashboard

Clock Styles

  • Large: Big bold time display
  • Minimal: Clean, simple layout
  • Digital: LED-style digits
  • Analog: Traditional clock face

Photo Sources

  • Device photo albums (via PhotoKit)
  • iCloud shared albums
  • Home Assistant media browser

Test Plan

  • Clock screensaver displays correctly in all styles
  • Entity values update in real-time on clock
  • Photo slideshow loads from device albums
  • Photo transitions work (fade, slide)
  • Custom URL screensaver loads HA dashboard
  • Pixel shift moves content periodically
  • Day/night brightness applies correctly

PR Series

# PR Status Description
1 #4197 🟡 Open Foundation
2 #4198 🟡 Open Core Manager
3 This 📍 This PR Screensaver Views
4 TBD 🔜 Navigation Lockdown
5 TBD 🔜 Security UI
6 TBD 🔜 Notification Commands
7 TBD 🔜 Camera & Settings UI

🤖 Generated with Claude Code

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
nstefanelli added a commit to nstefanelli/ha-kiosk that referenced this pull request Jan 9, 2026
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
@bgoncal bgoncal requested a review from Copilot January 9, 2026 18:53
Copy link
Contributor

Copilot AI left a 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 adds screensaver display modes and photo management as part 3 of a 7-part kiosk mode feature. It introduces multiple screensaver modes (clock, photos, custom URL, dim, blank) with various display styles, photo slideshow functionality from multiple sources (local, iCloud, Home Assistant media), and integration with the main WebViewController through a comprehensive extension. The changes include ~1,700 lines across screensaver views, photo management, entity state providers, and supporting utilities for animations, feedback, and security.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
WebViewController.swift Changed private properties to internal for kiosk mode access; added screensaver integration hooks
WebViewController+Kiosk.swift New comprehensive extension integrating kiosk mode with WebViewController
TouchFeedbackManager.swift New utility for haptic and sound feedback
IconMapper.swift New utility mapping Material Design Icons to SF Symbols
AnimationUtilities.swift New utility providing consistent animation definitions
SettingsManager.swift New manager for settings import/export functionality
SecurityManager.swift New manager for biometric authentication and security features
ScreensaverViewController.swift New controller managing screensaver view lifecycle
PhotoScreensaverView.swift New SwiftUI view for photo slideshow screensaver
PhotoManager.swift New manager handling photo loading from multiple sources
EntityStateProvider.swift New provider for real-time Home Assistant entity states
CustomURLScreensaverView.swift New view displaying custom URL content in WebView
ClockScreensaverView.swift New view displaying clock with multiple styles and entity data
KioskSettings.swift New comprehensive settings model (794 lines)
KioskModeManager.swift New central manager coordinating kiosk functionality (972 lines)
KioskConstants.swift New constants file for consistent values
DashboardManager.swift New manager for dashboard rotation and scheduling
CameraDetectionManager.swift New manager for camera-based motion/presence detection
AppLauncherManager.swift New manager for external app launching
project.pbxproj Xcode project file updates adding new source files

- Renamed isEnabled to isKioskModeEnabled for clarity
- Removed exitPIN (using device-based authentication only)
- Changed allowDevicePasscodeExit default to true

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@nstefanelli
Copy link
Author

All review feedback has been addressed:

  • Renamed isEnabled to isKioskModeEnabled for clarity
  • Removed PIN-based authentication in favor of device-level authentication (Face ID/Touch ID/Device Passcode)
  • Fixed iOS 15+ compatibility (replaced NavigationStack, ContentUnavailableView, etc.)
  • Added kiosk_mode/set WebSocket command support for HA 2026.1+
  • All Copilot review threads resolved

Ready for re-review. 🙏

@nstefanelli
Copy link
Author

Closing to restructure the PR series. See #4197 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant