From 2e9f5f9b740bab598ea7598392594551d625db99 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Mon, 13 Mar 2023 22:00:43 -0700 Subject: [PATCH] Rename `expand_toggle` action to `expand`. --- README.md | 10 +++++----- src/card.ts | 4 ++-- src/types.ts | 2 +- src/utils/querystring.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6682085c..c4241e7c 100644 --- a/README.md +++ b/README.md @@ -1113,7 +1113,7 @@ Parameters for the `custom:frigate-card-ptz` element: | Parameter | Description | | - | - | | `action` | Must be `custom:frigate-card-action`. | -| `frigate_card_action` | Call a Frigate Card action. Acceptable values are `default`, `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots`, `download`, `timeline`, `camera_ui`, `fullscreen`, `camera_select`, `menu_toggle`, `media_player`, `live_substream_select`, `expand_toggle`.| +| `frigate_card_action` | Call a Frigate Card action. Acceptable values are `default`, `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots`, `download`, `timeline`, `camera_ui`, `fullscreen`, `camera_select`, `menu_toggle`, `media_player`, `live_substream_select`, `expand`.| @@ -1130,7 +1130,7 @@ Parameters for the `custom:frigate-card-ptz` element: |`menu_toggle` | Show/hide the menu (for the `hidden` mode style). | |`media_player`| Perform a media player action. Takes a `media_player` parameter with the entity ID of the media_player on which to perform the action, and a `media_player_action` parameter which should be either `play` or `stop` to play or stop the media in question. | |`live_substream_select`| Perform a media player action. Takes a `camera` parameter with the [camera ID](#camera-ids) of the substream camera. | -|`expand_toggle`| Expand the card into a dialog/popup. | +|`expand`| Expand the card into a dialog/popup. | @@ -3416,7 +3416,7 @@ The card can respond to actions in the query string (see [below](#query-string-a This example assumes the dashboard URL is `https://ha.mydomain.org/lovelace-test/0`. ``` -https://ha.mydomain.org/lovelace-test/0?frigate-card-action:camera_select=kitchen&frigate-card-action:expand_toggle +https://ha.mydomain.org/lovelace-test/0?frigate-card-action:camera_select=kitchen&frigate-card-action:expand ``` @@ -3533,8 +3533,8 @@ To send an action to a named Frigate card on the dashboard: | `clips` | :white_check_mark: | | | `default` | :white_check_mark: | | | `download`| :heavy_multiplication_x: | Latest media information is not available on initial render. | -| `expand_toggle` | :white_check_mark: | | -| `fullscreen` | :heavy_multiplication_x: | Javascript does not support activating fullscreen without direct human interaction. Use `expand_toggle` as an alternative. | +| `expand` | :white_check_mark: | | +| `fullscreen` | :heavy_multiplication_x: | Javascript does not support activating fullscreen without direct human interaction. Use `expand` as an alternative. | | `image` | :white_check_mark: | | | `live_substream_select` | :white_check_mark: | | | `live` | :white_check_mark: | | diff --git a/src/card.ts b/src/card.ts index 0567edef..1a30682e 100644 --- a/src/card.ts +++ b/src/card.ts @@ -634,7 +634,7 @@ class FrigateCard extends LitElement { type: 'custom:frigate-card-menu-icon', title: localize('config.menu.buttons.expand'), tap_action: createFrigateCardCustomAction( - 'expand_toggle', + 'expand', ) as FrigateCardCustomAction, style: this._expand ? this._getEmphasizedStyle() : {}, }); @@ -1497,7 +1497,7 @@ class FrigateCard extends LitElement { case 'diagnostics': this._diagnostics(); break; - case 'expand_toggle': + case 'expand': this._setExpand(!this._expand); break; default: diff --git a/src/types.ts b/src/types.ts index bfcd62f7..e3c67717 100644 --- a/src/types.ts +++ b/src/types.ts @@ -216,7 +216,7 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [ 'clips', 'default', 'diagnostics', - 'expand_toggle', + 'expand', 'download', 'fullscreen', 'image', diff --git a/src/utils/querystring.ts b/src/utils/querystring.ts index 133d9ca0..27f9201b 100644 --- a/src/utils/querystring.ts +++ b/src/utils/querystring.ts @@ -31,7 +31,7 @@ export const getActionsFromQueryString = (): FrigateCardCustomAction[] => { case 'default': case 'diagnostics': case 'download': - case 'expand_toggle': + case 'expand': case 'image': case 'live': case 'menu_toggle':