feat: Make cameras optional (#2343)

This commit is contained in:
Dermot Duffy
2026-02-13 20:21:05 -08:00
committed by GitHub
parent 21f9469784
commit 93f1f08e51
61 changed files with 1312 additions and 557 deletions
+19 -3
View File
@@ -2,7 +2,13 @@
The card supports a myriad of configuration options for simple or complex setups.
### Minimal configuration
### Absolute minimum configuration
```yaml
type: custom:advanced-camera-card
```
### Minimal camera configuration
```yaml
type: custom:advanced-camera-card
@@ -10,20 +16,30 @@ cameras:
- camera_entity: camera.office
```
### Minimal folder configuration
```yaml
type: custom:advanced-camera-card
folders:
- type: ha
```
### Configuration blocks
#### Top-level configuration blocks
Only the `cameras` option is required, all other parameters are optional.
No top-level option is required. If `cameras` is omitted the card will still
render and can operate in `image` or `folders` views depending on configuration.
| Option | Description |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`automations`](automations.md) | Take action when conditions are met. |
| [`cameras`](cameras/README.md) | Configures the cameras to be used in the card. At least one camera must be specified. |
| [`cameras`](cameras/README.md) | Configures the cameras to be used in the card. Optional. If present, the first listed camera is the default. |
| [`cameras_global`](cameras/README.md) | Global defaults that apply to all cameras from the `cameras` section. |
| `card_id` | An optional ID to uniquely identify this card. For use when actions are being sent to card(s) via [URL actions](../usage/url-actions.md). Must exclusively consist of these characters: `[a-zA-Z0-9_]`. |
| [`dimensions`](dimensions.md) | Configures the overall card dimensions. |
| [`elements`](elements/README.md) | Add custom elements to the card. |
| [`folders`](folders.md) | Configures folders to be used in the card. Optional. If present, the first listed camera is the default. |
| [`image`](image.md) | Configures the `image` view. |
| [`live`](live.md) | Configures the `live` view. |
| [`media_gallery`](media-gallery.md) | Configures the media gallery. |
+1 -1
View File
@@ -1,6 +1,6 @@
# Cameras
The `cameras` block configures a list of cameras the card should support. The first listed camera is the default.
The `cameras` block configures a list of cameras the card should support. This block is optional. When present, the first listed camera is the default.
```yaml
cameras:
+3 -3
View File
@@ -12,7 +12,7 @@ view:
| `actions` | | [Actions](actions/README.md) to use for all views, individual actions may be overriden by view-specific actions. |
| `camera_select` | `current` | The [view](view.md?id=supported-views) to show when a new camera is selected (e.g. in the camera menu). If `current` the view is unchanged when a new camera is selected. |
| `dim` | `false` | Whether or not to 'dim' the brightness of the card (by 25%) if the card `interaction_seconds` has expired (i.e. card has been left unattended for that period of time). |
| `default` | `live` | The view to show in the card by default. The default camera is the first one listed. See [Supported Views](view.md?id=supported-views) below. |
| `default` | `auto` | The view to show in the card by default. If `auto`, the card will choose `live` when cameras are configured, `folders` when folders are configured, or `image` otherwise (screensaver). The default camera is the first one listed. See [Supported Views](view.md?id=supported-views) below. |
| `default_reset` | | The circumstances and behavior that cause the card to reset to the default view. See below. |
| `interaction_seconds` | `300` | After a mouse/touch interaction with the card, it will be considered "interacted with" until this number of seconds elapses without further interaction. May be used as part of an [interaction condition](conditions.md?id=interaction) or with `reset_after_interaction` to reset the view after the interaction is complete. |
| `keyboard_shortcuts` | See [usage](../usage/keyboard-shortcuts.md) for defaults. | Configure keyboard shortcuts. See below. |
@@ -155,7 +155,7 @@ This card supports several different views.
| `snapshots` | Shows a gallery of snapshots for this camera. |
| `timeline` | Shows an event timeline. |
The default view is `live`, but can be configured by the `view.default` parameter.
The default view is `auto`. It will select `live` when cameras are configured, `folders` when folders are configured, or `image` otherwise (screensaver). You can override this with `view.default`.
## Fully expanded reference
@@ -163,7 +163,7 @@ The default view is `live`, but can be configured by the `view.default` paramete
```yaml
view:
default: live
default: auto
camera_select: current
interaction_seconds: 300
default_cycle_camera: false