Merge pull request #947 from dermotduffy/action-rename
Rename `frigate_ui` action to `camera_ui`
This commit is contained in:
@@ -300,7 +300,7 @@ menu:
|
|||||||
| `recordings` | :white_check_mark: | The `recordings` view menu button: brings the user to the `recordings` view on tap and the most-recent `recording` view on hold. See [views](#views) below. This button will never be shown if the `frigate.camera_name` for the selected camera is not auto-detected/specified (e.g. non-Frigate cameras), or if the `frigate.camera_name` is `birdseye`.|
|
| `recordings` | :white_check_mark: | The `recordings` view menu button: brings the user to the `recordings` view on tap and the most-recent `recording` view on hold. See [views](#views) below. This button will never be shown if the `frigate.camera_name` for the selected camera is not auto-detected/specified (e.g. non-Frigate cameras), or if the `frigate.camera_name` is `birdseye`.|
|
||||||
| `image` | :white_check_mark: | The `image` view menu button: brings the user to the static `image` view. See [views](#views) below.|
|
| `image` | :white_check_mark: | The `image` view menu button: brings the user to the static `image` view. See [views](#views) below.|
|
||||||
| `download` | :white_check_mark: | The `download` menu button: allow direct download of the media being displayed.|
|
| `download` | :white_check_mark: | The `download` menu button: allow direct download of the media being displayed.|
|
||||||
| `frigate_ui` | :white_check_mark: | The `frigate_ui` menu button: brings the user to a context-appropriate page on the Frigate UI (e.g. the camera homepage). Will only appear if the `frigate.url` option is set.|
|
| `camera_ui` | :white_check_mark: | The `camera_ui` menu button: brings the user to a context-appropriate page on the UI of their camera engine (e.g. the Frigate camera homepage). Will only appear if the camera engine supports a camera UI (e.g. if `frigate.url` option is set for `frigate` engine users).|
|
||||||
| `fullscreen` | :white_check_mark: | The `fullscreen` menu button: expand the card to consume the fullscreen. |
|
| `fullscreen` | :white_check_mark: | The `fullscreen` menu button: expand the card to consume the fullscreen. |
|
||||||
| `timeline` | :white_check_mark: | The `timeline` menu button: show the event timeline. |
|
| `timeline` | :white_check_mark: | The `timeline` menu button: show the event timeline. |
|
||||||
| `media_player` | :white_check_mark: | The `media_player` menu button: sends the visible media to a remote media player. Supports Frigate clips, snapshots and live camera (only for cameras that specify a `camera_entity` and only using the default HA stream (equivalent to the `ha` live provider). `jsmpeg` or `webrtc-card` are not supported, although live can still be played as long as `camera_entity` is specified. In the player list, a `tap` will send the media to the player, a `hold` will stop the media on the player. |
|
| `media_player` | :white_check_mark: | The `media_player` menu button: sends the visible media to a remote media player. Supports Frigate clips, snapshots and live camera (only for cameras that specify a `camera_entity` and only using the default HA stream (equivalent to the `ha` live provider). `jsmpeg` or `webrtc-card` are not supported, although live can still be played as long as `camera_entity` is specified. In the player list, a `tap` will send the media to the player, a `hold` will stop the media on the player. |
|
||||||
@@ -1057,7 +1057,7 @@ Parameters for the `custom:frigate-card-ptz` element:
|
|||||||
| Parameter | Description |
|
| Parameter | Description |
|
||||||
| - | - |
|
| - | - |
|
||||||
| `action` | Must be `custom:frigate-card-action`. |
|
| `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`, `frigate_ui`, `fullscreen`, `camera_select`, `menu_toggle`, `media_player`.|
|
| `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`.|
|
||||||
|
|
||||||
##### Command descriptions
|
##### Command descriptions
|
||||||
|
|
||||||
@@ -1066,7 +1066,7 @@ Parameters for the `custom:frigate-card-ptz` element:
|
|||||||
| `default` | Trigger the default view. |
|
| `default` | Trigger the default view. |
|
||||||
| `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots` | Trigger the named [view](#views).|
|
| `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots` | Trigger the named [view](#views).|
|
||||||
|`download`|Download the displayed media.|
|
|`download`|Download the displayed media.|
|
||||||
|`frigate_ui`|Open the Frigate UI at the configured URL.|
|
|`camera_ui`|Open the Frigate UI at the configured URL.|
|
||||||
|`fullscreen`|Toggle fullscreen.|
|
|`fullscreen`|Toggle fullscreen.|
|
||||||
|`camera_select`|Select a given camera. Takes a single additional `camera` parameter with the [camera ID](#camera-ids) of the camera to select. Respects the value of `view.camera_select` to choose the appropriate view on the new camera.|
|
|`camera_select`|Select a given camera. Takes a single additional `camera` parameter with the [camera ID](#camera-ids) of the camera to select. Respects the value of `view.camera_select` to choose the appropriate view on the new camera.|
|
||||||
|`menu_toggle` | Show/hide the menu (for the `hidden` mode style). |
|
|`menu_toggle` | Show/hide the menu (for the `hidden` mode style). |
|
||||||
@@ -1455,7 +1455,7 @@ menu:
|
|||||||
enabled: true
|
enabled: true
|
||||||
alignment: matching
|
alignment: matching
|
||||||
icon: mdi:download
|
icon: mdi:download
|
||||||
frigate_ui:
|
camera_ui:
|
||||||
priority: 50
|
priority: 50
|
||||||
enabled: true
|
enabled: true
|
||||||
alignment: matching
|
alignment: matching
|
||||||
@@ -1976,7 +1976,7 @@ elements:
|
|||||||
title: Open Frigate UI
|
title: Open Frigate UI
|
||||||
tap_action:
|
tap_action:
|
||||||
action: custom:frigate-card-action
|
action: custom:frigate-card-action
|
||||||
frigate_card_action: frigate_ui
|
frigate_card_action: camera_ui
|
||||||
- type: custom:frigate-card-menu-icon
|
- type: custom:frigate-card-menu-icon
|
||||||
icon: mdi:alpha-j-circle
|
icon: mdi:alpha-j-circle
|
||||||
title: Change to fullscreen
|
title: Change to fullscreen
|
||||||
@@ -2175,7 +2175,7 @@ overrides:
|
|||||||
enabled: true
|
enabled: true
|
||||||
alignment: matching
|
alignment: matching
|
||||||
icon: mdi:download
|
icon: mdi:download
|
||||||
frigate_ui:
|
camera_ui:
|
||||||
priority: 50
|
priority: 50
|
||||||
enabled: true
|
enabled: true
|
||||||
alignment: matching
|
alignment: matching
|
||||||
|
|||||||
+4
-4
@@ -531,11 +531,11 @@ class FrigateCard extends LitElement {
|
|||||||
if (this._getCameraURLFromContext()) {
|
if (this._getCameraURLFromContext()) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
icon: 'mdi:web',
|
icon: 'mdi:web',
|
||||||
...this._getConfig().menu.buttons.frigate_ui,
|
...this._getConfig().menu.buttons.camera_ui,
|
||||||
type: 'custom:frigate-card-menu-icon',
|
type: 'custom:frigate-card-menu-icon',
|
||||||
title: localize('config.menu.buttons.frigate_ui'),
|
title: localize('config.menu.buttons.camera_ui'),
|
||||||
tap_action: createFrigateCardCustomAction(
|
tap_action: createFrigateCardCustomAction(
|
||||||
'frigate_ui',
|
'camera_ui',
|
||||||
) as FrigateCardCustomAction,
|
) as FrigateCardCustomAction,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1337,7 +1337,7 @@ class FrigateCard extends LitElement {
|
|||||||
case 'download':
|
case 'download':
|
||||||
this._downloadViewerMedia();
|
this._downloadViewerMedia();
|
||||||
break;
|
break;
|
||||||
case 'frigate_ui':
|
case 'camera_ui':
|
||||||
const url = this._getCameraURLFromContext();
|
const url = this._getCameraURLFromContext();
|
||||||
if (url) {
|
if (url) {
|
||||||
window.open(url);
|
window.open(url);
|
||||||
|
|||||||
+26
-2
@@ -18,10 +18,10 @@ import {
|
|||||||
CONF_MEDIA_VIEWER,
|
CONF_MEDIA_VIEWER,
|
||||||
CONF_MENU,
|
CONF_MENU,
|
||||||
CONF_MENU_BUTTONS_CAMERAS,
|
CONF_MENU_BUTTONS_CAMERAS,
|
||||||
|
CONF_MENU_BUTTONS_CAMERA_UI,
|
||||||
CONF_MENU_BUTTONS_CLIPS,
|
CONF_MENU_BUTTONS_CLIPS,
|
||||||
CONF_MENU_BUTTONS_DOWNLOAD,
|
CONF_MENU_BUTTONS_DOWNLOAD,
|
||||||
CONF_MENU_BUTTONS_FRIGATE,
|
CONF_MENU_BUTTONS_FRIGATE,
|
||||||
CONF_MENU_BUTTONS_FRIGATE_UI,
|
|
||||||
CONF_MENU_BUTTONS_FULLSCREEN,
|
CONF_MENU_BUTTONS_FULLSCREEN,
|
||||||
CONF_MENU_BUTTONS_IMAGE,
|
CONF_MENU_BUTTONS_IMAGE,
|
||||||
CONF_MENU_BUTTONS_LIVE,
|
CONF_MENU_BUTTONS_LIVE,
|
||||||
@@ -599,6 +599,24 @@ const transformConditionMediaLoaded = (data: unknown): boolean => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform action frigate_ui -> camera_ui
|
||||||
|
* @param data Input data.
|
||||||
|
* @returns `true` if the configuration was modified.
|
||||||
|
*/
|
||||||
|
const transformFrigateUIAction = (data: unknown): boolean => {
|
||||||
|
if (
|
||||||
|
typeof data === 'object' &&
|
||||||
|
data &&
|
||||||
|
data['action'] === 'custom:frigate-card-action' &&
|
||||||
|
data['frigate_card_action'] === 'frigate_ui'
|
||||||
|
) {
|
||||||
|
data['frigate_card_action'] = 'camera_ui';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
const UPGRADES = [
|
const UPGRADES = [
|
||||||
// v1.2.1 -> v2.0.0
|
// v1.2.1 -> v2.0.0
|
||||||
upgradeMoveTo('frigate_url', 'frigate.url'),
|
upgradeMoveTo('frigate_url', 'frigate.url'),
|
||||||
@@ -671,7 +689,7 @@ const UPGRADES = [
|
|||||||
upgradeWithOverrides(CONF_MENU_BUTTONS_SNAPSHOTS, menuButtonBooleanToObject),
|
upgradeWithOverrides(CONF_MENU_BUTTONS_SNAPSHOTS, menuButtonBooleanToObject),
|
||||||
upgradeWithOverrides(CONF_MENU_BUTTONS_IMAGE, menuButtonBooleanToObject),
|
upgradeWithOverrides(CONF_MENU_BUTTONS_IMAGE, menuButtonBooleanToObject),
|
||||||
upgradeWithOverrides(CONF_MENU_BUTTONS_DOWNLOAD, menuButtonBooleanToObject),
|
upgradeWithOverrides(CONF_MENU_BUTTONS_DOWNLOAD, menuButtonBooleanToObject),
|
||||||
upgradeWithOverrides(CONF_MENU_BUTTONS_FRIGATE_UI, menuButtonBooleanToObject),
|
upgradeWithOverrides('menu.buttons.frigate_ui', menuButtonBooleanToObject),
|
||||||
upgradeWithOverrides(CONF_MENU_BUTTONS_FULLSCREEN, menuButtonBooleanToObject),
|
upgradeWithOverrides(CONF_MENU_BUTTONS_FULLSCREEN, menuButtonBooleanToObject),
|
||||||
upgrade(CONF_LIVE_LAZY_UNLOAD, (val) =>
|
upgrade(CONF_LIVE_LAZY_UNLOAD, (val) =>
|
||||||
typeof val === 'boolean' ? (val ? 'all' : 'never') : undefined,
|
typeof val === 'boolean' ? (val ? 'all' : 'never') : undefined,
|
||||||
@@ -711,4 +729,10 @@ const UPGRADES = [
|
|||||||
)(typeof data === 'object' && data ? data[CONF_ELEMENTS] : {});
|
)(typeof data === 'object' && data ? data[CONF_ELEMENTS] : {});
|
||||||
},
|
},
|
||||||
upgradeMoveToWithOverrides('event_gallery', CONF_MEDIA_GALLERY),
|
upgradeMoveToWithOverrides('event_gallery', CONF_MEDIA_GALLERY),
|
||||||
|
upgradeMoveToWithOverrides('menu.buttons.frigate_ui', CONF_MENU_BUTTONS_CAMERA_UI),
|
||||||
|
(data: unknown): boolean => {
|
||||||
|
return recursiveUpgradeObject(transformFrigateUIAction)(
|
||||||
|
typeof data === 'object' && data ? <RawFrigateCardConfig>data : {},
|
||||||
|
);
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
+1
-1
@@ -194,7 +194,7 @@ export const CONF_MENU_BUTTONS_CAMERAS = `${CONF_MENU}.buttons.cameras` as const
|
|||||||
export const CONF_MENU_BUTTONS_CLIPS = `${CONF_MENU}.buttons.clips` as const;
|
export const CONF_MENU_BUTTONS_CLIPS = `${CONF_MENU}.buttons.clips` as const;
|
||||||
export const CONF_MENU_BUTTONS_DOWNLOAD = `${CONF_MENU}.buttons.download` as const;
|
export const CONF_MENU_BUTTONS_DOWNLOAD = `${CONF_MENU}.buttons.download` as const;
|
||||||
export const CONF_MENU_BUTTONS_FRIGATE = `${CONF_MENU}.buttons.frigate` as const;
|
export const CONF_MENU_BUTTONS_FRIGATE = `${CONF_MENU}.buttons.frigate` as const;
|
||||||
export const CONF_MENU_BUTTONS_FRIGATE_UI = `${CONF_MENU}.buttons.frigate_ui` as const;
|
export const CONF_MENU_BUTTONS_CAMERA_UI = `${CONF_MENU}.buttons.camera_ui` as const;
|
||||||
export const CONF_MENU_BUTTONS_FULLSCREEN = `${CONF_MENU}.buttons.fullscreen` as const;
|
export const CONF_MENU_BUTTONS_FULLSCREEN = `${CONF_MENU}.buttons.fullscreen` as const;
|
||||||
export const CONF_MENU_BUTTONS_IMAGE = `${CONF_MENU}.buttons.image` as const;
|
export const CONF_MENU_BUTTONS_IMAGE = `${CONF_MENU}.buttons.image` as const;
|
||||||
export const CONF_MENU_BUTTONS_LIVE = `${CONF_MENU}.buttons.live` as const;
|
export const CONF_MENU_BUTTONS_LIVE = `${CONF_MENU}.buttons.live` as const;
|
||||||
|
|||||||
+1
-1
@@ -1579,7 +1579,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
|||||||
${this._renderMenuButton('recordings')}
|
${this._renderMenuButton('recordings')}
|
||||||
${this._renderMenuButton('image') /* */}
|
${this._renderMenuButton('image') /* */}
|
||||||
${this._renderMenuButton('download')}
|
${this._renderMenuButton('download')}
|
||||||
${this._renderMenuButton('frigate_ui')}
|
${this._renderMenuButton('camera_ui')}
|
||||||
${this._renderMenuButton('fullscreen')}
|
${this._renderMenuButton('fullscreen')}
|
||||||
${this._renderMenuButton('timeline')}
|
${this._renderMenuButton('timeline')}
|
||||||
${this._renderMenuButton('media_player')}
|
${this._renderMenuButton('media_player')}
|
||||||
|
|||||||
@@ -215,12 +215,12 @@
|
|||||||
"matching": "Matching the menu alignment",
|
"matching": "Matching the menu alignment",
|
||||||
"opposing": "Opposing the menu alignment"
|
"opposing": "Opposing the menu alignment"
|
||||||
},
|
},
|
||||||
|
"camera_ui": "Camera user interface",
|
||||||
"cameras": "Cameras",
|
"cameras": "Cameras",
|
||||||
"clips": "Clips",
|
"clips": "Clips",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"enabled": "Button enabled",
|
"enabled": "Button enabled",
|
||||||
"frigate": "Frigate menu / Default view",
|
"frigate": "Frigate menu / Default view",
|
||||||
"frigate_ui": "Frigate user interface",
|
|
||||||
"fullscreen": "Fullscreen",
|
"fullscreen": "Fullscreen",
|
||||||
"icon": "Icon",
|
"icon": "Icon",
|
||||||
"image": "Image",
|
"image": "Image",
|
||||||
|
|||||||
@@ -209,12 +209,12 @@
|
|||||||
"matching": "Corrispondenza con l'allineamento del menu",
|
"matching": "Corrispondenza con l'allineamento del menu",
|
||||||
"opposing": "Contrastare l'allineamento del menu"
|
"opposing": "Contrastare l'allineamento del menu"
|
||||||
},
|
},
|
||||||
|
"camera_ui": "",
|
||||||
"cameras": "Telecamere",
|
"cameras": "Telecamere",
|
||||||
"clips": "Clip",
|
"clips": "Clip",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"enabled": "Pulsante abilitato",
|
"enabled": "Pulsante abilitato",
|
||||||
"frigate": "Frigate menu / Visualizzazione predefinita",
|
"frigate": "Frigate menu / Visualizzazione predefinita",
|
||||||
"frigate_ui": "Frigate interfaccia utente",
|
|
||||||
"fullscreen": "A schermo intero",
|
"fullscreen": "A schermo intero",
|
||||||
"icon": "Icona",
|
"icon": "Icona",
|
||||||
"image": "Immagine",
|
"image": "Immagine",
|
||||||
|
|||||||
@@ -209,12 +209,12 @@
|
|||||||
"matching": "Mesmo alinhamento do menu",
|
"matching": "Mesmo alinhamento do menu",
|
||||||
"opposing": "Opor-se ao alinhamento do menu"
|
"opposing": "Opor-se ao alinhamento do menu"
|
||||||
},
|
},
|
||||||
|
"camera_ui": "",
|
||||||
"cameras": "Selecionar câmera",
|
"cameras": "Selecionar câmera",
|
||||||
"clips": "Clipes",
|
"clips": "Clipes",
|
||||||
"download": "Baixe a mídia do evento",
|
"download": "Baixe a mídia do evento",
|
||||||
"enabled": "Botão ativado",
|
"enabled": "Botão ativado",
|
||||||
"frigate": "Frigate menu / Visualização padrão",
|
"frigate": "Frigate menu / Visualização padrão",
|
||||||
"frigate_ui": "Frigate Interface de usuário",
|
|
||||||
"fullscreen": "Tela cheia",
|
"fullscreen": "Tela cheia",
|
||||||
"icon": "Ícone",
|
"icon": "Ícone",
|
||||||
"image": "Imagem",
|
"image": "Imagem",
|
||||||
|
|||||||
+3
-3
@@ -210,7 +210,7 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [
|
|||||||
'snapshots',
|
'snapshots',
|
||||||
'timeline',
|
'timeline',
|
||||||
'download',
|
'download',
|
||||||
'frigate_ui',
|
'camera_ui',
|
||||||
'fullscreen',
|
'fullscreen',
|
||||||
'menu_toggle',
|
'menu_toggle',
|
||||||
'diagnostics',
|
'diagnostics',
|
||||||
@@ -937,7 +937,7 @@ const menuConfigDefault = {
|
|||||||
image: hiddenButtonDefault,
|
image: hiddenButtonDefault,
|
||||||
timeline: visibleButtonDefault,
|
timeline: visibleButtonDefault,
|
||||||
download: visibleButtonDefault,
|
download: visibleButtonDefault,
|
||||||
frigate_ui: visibleButtonDefault,
|
camera_ui: visibleButtonDefault,
|
||||||
fullscreen: visibleButtonDefault,
|
fullscreen: visibleButtonDefault,
|
||||||
media_player: visibleButtonDefault,
|
media_player: visibleButtonDefault,
|
||||||
recordings: hiddenButtonDefault,
|
recordings: hiddenButtonDefault,
|
||||||
@@ -969,7 +969,7 @@ const menuConfigSchema = z
|
|||||||
image: hiddenButtonSchema.default(menuConfigDefault.buttons.image),
|
image: hiddenButtonSchema.default(menuConfigDefault.buttons.image),
|
||||||
timeline: visibleButtonSchema.default(menuConfigDefault.buttons.timeline),
|
timeline: visibleButtonSchema.default(menuConfigDefault.buttons.timeline),
|
||||||
download: visibleButtonSchema.default(menuConfigDefault.buttons.download),
|
download: visibleButtonSchema.default(menuConfigDefault.buttons.download),
|
||||||
frigate_ui: visibleButtonSchema.default(menuConfigDefault.buttons.frigate_ui),
|
camera_ui: visibleButtonSchema.default(menuConfigDefault.buttons.camera_ui),
|
||||||
fullscreen: visibleButtonSchema.default(menuConfigDefault.buttons.fullscreen),
|
fullscreen: visibleButtonSchema.default(menuConfigDefault.buttons.fullscreen),
|
||||||
media_player: visibleButtonSchema.default(
|
media_player: visibleButtonSchema.default(
|
||||||
menuConfigDefault.buttons.media_player,
|
menuConfigDefault.buttons.media_player,
|
||||||
|
|||||||
Reference in New Issue
Block a user