mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-17 04:10:52 -06:00
## Summary
Implements a camera list view accessible from iOS 18+ control widgets
and deeplinks, displaying all cameras from the database with server
filtering, area information, and search capabilities. Tapping a camera
opens the WebRTC video player in full screen on top of the list.
**New Components:**
- `CameraListView` - SwiftUI list with conditional server selector,
search, area display, and empty states
- `CameraListViewModel` - Fetches cameras via `ControlEntityProvider`,
handles filtering, and maps camera areas
- `OpenCameraListAppIntent` - iOS 18+ app intent for opening camera list
- `ControlOpenCamerasList` - iOS 18+ control widget for Control Center
(no configuration needed)
**Key Features:**
- **Server Picker**: Hidden when initialized with specific serverId,
always visible otherwise
- **Area Display**: Shows area name (if available) or entity ID for each
camera
- **Full Screen Behavior**: Camera opens on top of list modal without
dismissing it
- **Search**: Real-time filtering by camera name or entity ID
- **Localization**: All user-facing strings use the localization system
(`L10n.CameraList.*`)
- **Control Widgets**: Two iOS 18+ widgets for Control Center access
**iOS 18+ Control Widgets:**
1. **ControlOpenCamerasList** - Opens the full camera list with one tap
(static, no configuration)
2. **ControlOpenCamera** - Opens a specific camera directly (user
selects camera during setup)
**URL Routing:**
- `homeassistant://camera/` → Opens camera list
- `homeassistant://camera/?serverId={id}` → Opens filtered list (hides
server picker)
- `homeassistant://camera/?entityId={id}&serverId={id}` → Opens specific
camera (existing)
Updated `IncomingURLHandler.swift` to branch on `entityId` presence:
missing opens list, present opens player.
**Localization Keys:**
- `camera_list.title` - Navigation title
- `camera_list.search_placeholder` - Search bar placeholder
- `camera_list.empty.title` & `camera_list.empty.message` - Empty state
- `camera_list.no_results.title` & `camera_list.no_results.message` - No
search results
- `widgets.controls.open_cameras_list.description` - Control widget
description
**Tests:**
- Updated `WidgetsKindTests` to include assertion for
`controlOpenCamerasList` enum case
- Total enum case count updated from 26 to 27
## Screenshots
_Screenshots required for testing on macOS/iOS device_
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
Files added to both App and Extensions-Widgets targets for proper iOS
18+ control support. Backward compatible with existing camera deeplinks.
ViewModel fetches area information from the database and maps it to
cameras for display. All strings are properly localized and ready for
translation.
The `ControlOpenCamerasList` widget uses `StaticControlConfiguration`,
requiring no user setup, making it quick to add to Control Center for
instant access to all cameras.
Tests have been updated to reflect the new `controlOpenCamerasList`
widget kind after merging with main branch changes.
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> In the App we have the options to open WebRTCVideoPlayerView from iOS
18+ controls, implement a screen that presents a list of cameras base on
all cameras in the database.
> This screen should have a server selector as well and it should allow
initializing with a specific serverId, so the list is displayed based on
1 server only.
> When tapping list row, it opens WebRTCVideoPlayerView for that
selected camera in full screen
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>