fix: Expose gallery and media views as media type agnostic (#2335)

This commit is contained in:
Dermot Duffy
2026-02-08 08:04:11 -08:00
committed by GitHub
parent 0a099b95f7
commit 21f9469784
22 changed files with 363 additions and 238 deletions
@@ -157,6 +157,15 @@ advanced_camera_card_action: folders
| --------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `folder` | The first configured folder (under [`folders`](../../folders.md)). | An optional id of the folder to show, see the `id` parameter under [`folders` configuration](../../folders.md). |
## `gallery`
Change to the `gallery` view.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: gallery
```
## `fullscreen`
Toggle fullscreen.
@@ -237,6 +246,15 @@ advanced_camera_card_action: live_substream_select
| `advanced_camera_card_action` | Must be `live_substream_select`. |
| `camera` | The [camera ID](../../cameras/README.md?id=cameras) of the substream to select. |
## `media`
Change to the `media` view.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: media
```
## `log`
Log a message to the Javascript console.
@@ -463,6 +481,24 @@ action: custom:advanced-camera-card-action
advanced_camera_card_action: recordings
```
## `review`
Change to the `review` view.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: review
```
## `reviews`
Change to the `reviews` view.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: reviews
```
## `reload`
Reload the entire dashboard.
@@ -591,6 +627,33 @@ elements:
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: camera_ui
- type: custom:advanced-camera-card-menu-icon
icon: mdi:play-box-multiple
title: Show media gallery
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: gallery
hold_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: media
- type: custom:advanced-camera-card-menu-icon
icon: mdi:filmstrip
title: Show most recent media
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: media
- type: custom:advanced-camera-card-menu-icon
icon: mdi:alpha-r-circle-outline
title: Show most recent review
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: review
- type: custom:advanced-camera-card-menu-icon
icon: mdi:alpha-s-circle-outline
title: Show reviews
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: reviews
- type: custom:advanced-camera-card-menu-icon
icon: mdi:alpha-d-circle
title: Show most recent clip
+1 -1
View File
@@ -390,7 +390,7 @@ cameras:
| `events` | `[events, clips, snapshots]` | Whether to trigger the camera when `events` occur (whether or not media is available) or whenever updated `clips` or `snapshots` are detected. Detection support varies by camera [engine](engine.md). |
| `motion` | `false` | Whether to not to trigger the camera by automatically detecting and using the motion `binary_sensor` for this camera. This autodetection only works for Frigate cameras, and only when the motion `binary_sensor` entity has been enabled in Home Assistant. |
| `occupancy` | `false` | Whether to not to trigger the camera by automatically detecting and using the occupancy `binary_sensor` for this camera and its configured zones and labels. This autodetection only works for Frigate cameras, and only when the occupancy `binary_sensor` entity has been enabled in Home Assistant. If this camera has configured zones, only occupancy sensors for those zones are used -- if the overall _camera_ occupancy sensor is also required, it can be manually added to `entities`. If this camera has configured labels, only occupancy sensors for those labels are used. |
| `reviews` | | Configuration for triggering on Frigate review items. See below. Frigate-specific. |
| `reviews` | | Configuration for triggering on review items. Currently only supported by Frigate. See below. |
### `reviews`
+3 -3
View File
@@ -361,9 +361,9 @@ conditions:
> [!IMPORTANT]
> Internally, views associated with the media viewer (e.g. `clip`, `snapshot`,
> `recording`) are translated to a special view called `media` after the relevant
> media is fetched. When including views as part of a [condition](conditions.md),
> you may need to refer to this special `media` view.
> `review` `recording`) are translated to the `media` view after the relevant
> media is fetched. When including views as part of a
> [condition](conditions.md), you may need to refer to the `media` view.
## Fully expanded reference
+5 -6
View File
@@ -1,18 +1,17 @@
# `media_gallery`
The `media_gallery` is used for providing an overview of all `clips`,
`snapshots`, `recordings`, `reviews` and `folder` contents in a thumbnail
gallery.
`snapshots`, `recordings`, `reviews` and `folders`.
```yaml
media_gallery:
# [...]
```
| Option | Default | Description |
| ---------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | | [Actions](actions/README.md) to use for all views that use the `media_gallery` (e.g. `clips`, `folder`, `snapshots`, `recordings`). |
| `controls` | | Configuration for the Media Gallery controls. See below. |
| Option | Default | Description |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | | [Actions](actions/README.md) to use for all views that use the `media_gallery` (e.g. `clips`, `snapshots`, `recordings`, `reviews`, `folders`, `gallery`). |
| `controls` | | Configuration for the Media Gallery controls. See below. |
## `controls`
+2 -2
View File
@@ -1,6 +1,6 @@
# `media_viewer`
The `media_player` section configures viewing all `clip`, `snapshot` or `recording` media, in either a media carousel or grid.
The `media_viewer` section configures viewing all `clip`, `snapshot`, `recording`, `review`, `folder` or `media` view, in either a media carousel or grid.
```yaml
media_viewer:
@@ -9,7 +9,7 @@ media_viewer:
| Option | Default | Description |
| --------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | | [Actions](actions/README.md) to use for all views that use the `media_viewer` (e.g. `clip`, `snapshot`). |
| `actions` | | [Actions](actions/README.md) to use for all views that use the `media_viewer` (e.g. `media`, `clip`, `snapshot`, `recording`, `review`, `folder`). |
| `auto_mute` | `[unselected, hidden]` | A list of conditions in which media items are muted. `unselected` will automatically mute when a media item is unselected in the carousel or grid. `hidden` will automatically mute when the browser/tab becomes hidden. Use an empty list (`[]`) to never automatically mute. |
| `auto_pause` | `[unselected, hidden]` | A list of conditions in which media items are automatically paused. `unselected` will automatically pause when a media item is unselected in the carousel or grid. `hidden` will automatically pause when the browser/tab becomes hidden. Use an empty list (`[]`) to never automatically pause. |
| `auto_play` | `[selected, visible]` | A list of conditions in which media items are automatically played. `selected` will automatically play when a media item is selected in a carousel or grid. `visible` will automatically play when a media item becomes visible (e.g. browser tab change, or visible in a grid but not selected). Use an empty list (`[]`) to never automatically play. |
+4 -2
View File
@@ -130,7 +130,7 @@ action will be taken on card startup.
| Option | Default | Description |
| ------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `interaction_mode` | `inactive` | Whether actions should be taken when the card is being interacted with. If `all`, actions will always left be taken regardless. If `inactive` actions will only be taken if the card has _not_ had human interaction recently (as defined by `view.interaction_seconds`). If `active` actions will only be taken if the card _has_ had human interaction recently. This does not stop triggering itself (i.e. border will still pulse if `show_trigger_status` is true) but rather just prevents the actions being performed. |
| `trigger` | `update` | If set to `update` the current view is updated in place. If set to `default` the default view of the card will be reloaded. If set to `live` the triggered camera will be selected in `live` view. If set to `media` the appropriate media view (e.g. `clip` or `snapshot`) will be chosen to match a newly available media item (please note that only some [camera engines](cameras/engine.md) support new media detection, e.g. `frigate`). If set to `none` no action is taken. |
| `trigger` | `update` | If set to `update` the current view is updated in place. If set to `default` the default view of the card will be reloaded. If set to `live` the triggered camera will be selected in `live` view. If set to `media` the appropriate media view (e.g. `clip`, `snapshot`, `review`) will be chosen to match a newly available media item (please note that only some [camera engines](cameras/engine.md) support new media detection, e.g. `frigate`). If set to `none` no action is taken. |
| `untrigger` | `none` | If set to `default` the the default view of the card will be reloaded. If set to `none` no action will be taken. |
## Supported views
@@ -143,12 +143,14 @@ This card supports several different views.
| `clips` | Shows a gallery of clips for this camera. |
| `folder` | Shows a viewer for the media from the default [`folder`](./folders.md). |
| `folders` | Shows a gallery of media and subfolders from the default [`folder`](./folders.md). |
| `gallery` | Shows a gallery of media for this camera's default [media type](./cameras/README.md?id=media). |
| `image` | Shows a static image specified by the `image` parameter, can be used as a discrete default view or a screensaver (via `view.interaction_seconds`). |
| `live` | Shows the live camera view with the configured [live provider](./cameras/live-provider.md). |
| `media` | Shows a viewer for the most recent media for this camera. |
| `recording` | Shows a viewer for the most recent recording for this camera. Can also be accessed by holding down the `recordings` menu icon. |
| `recordings` | Shows a gallery of recent (last day) recordings for this camera and its dependents. |
| `review` | Shows a viewer for the most recent unreviewed review item (e.g. alerts/detections in Frigate). |
| `reviews` | Shows a viewer for the most recent unreviewed review item (e.g. alerts/detections in Frigate). |
| `reviews` | Shows a gallery of reviews for this camera and its dependents. |
| `snapshot` | Shows a viewer for the most recent snapshot for this camera. Can also be accessed by holding down the `snapshots` menu icon. |
| `snapshots` | Shows a gallery of snapshots for this camera. |
| `timeline` | Shows an event timeline. |
+10 -3
View File
@@ -4,7 +4,7 @@ It is possible to pass the Advanced Camera Card one or more
[actions](../configuration/actions/README.md) from the URL (e.g. select a particular
camera, open the live view in expanded mode, etc).
### When actions are executed
## When actions are executed
The Advanced Camera Card will execute these actions in the following circumstances:
@@ -19,13 +19,13 @@ The Advanced Camera Card will execute these actions in the following circumstanc
To send an action to _all_ Advanced Camera Cards on a dashboard:
```
```text
[PATH_TO_YOUR_HA_DASHBOARD]?advanced-camera-card-action.[ACTION]=[VALUE]
```
To send an action to a specific named Advanced Camera Card:
```
```text
[PATH_TO_YOUR_HA_DASHBOARD]?advanced-camera-card-action.[CARD_ID].[ACTION]=[VALUE]
```
@@ -58,12 +58,17 @@ Only a subset of all [actions](../configuration/actions/README.md) are supported
| `clip` | :white_check_mark: | |
| `clips` | :white_check_mark: | |
| `default` | :white_check_mark: | |
| `diagnostics` | :white_check_mark: | |
| `download` | :heavy_multiplication_x: | Latest media information is not available on initial render. |
| `expand` | :white_check_mark: | |
| `folder` | :white_check_mark: | |
| `folders` | :white_check_mark: | |
| `fullscreen` | :heavy_multiplication_x: | Javascript does not support activating fullscreen without direct human interaction. Use `expand` as an alternative. |
| `gallery` | :white_check_mark: | |
| `image` | :white_check_mark: | |
| `live_substream_select` | :white_check_mark: | |
| `live` | :white_check_mark: | |
| `media` | :white_check_mark: | |
| `media_player` | :heavy_multiplication_x: | Please [request](https://github.com/dermotduffy/advanced-camera-card/issues) if you need this. |
| `menu_toggle` | :white_check_mark: | |
| `microphone_connect`, `microphone_disconnect`, `microphone_mute`, `microphone_unmute` | :heavy_multiplication_x: | |
@@ -72,6 +77,8 @@ Only a subset of all [actions](../configuration/actions/README.md) are supported
| `ptz` | :heavy_multiplication_x: | Please [request](https://github.com/dermotduffy/advanced-camera-card/issues) if you need this. |
| `recording` | :white_check_mark: | |
| `recordings` | :white_check_mark: | |
| `review` | :white_check_mark: | |
| `reviews` | :white_check_mark: | |
| `screenshot` | :heavy_multiplication_x: | Latest media information is not available on initial render. |
| `ptz_controls` | :heavy_multiplication_x: | Please [request](https://github.com/dermotduffy/advanced-camera-card/issues) if you need this. |
| `snapshot` | :white_check_mark: | |