No longer support actions on timeline view.

This commit is contained in:
Dermot Duffy
2022-06-25 09:09:57 -07:00
parent 20d65f0e2c
commit 22ac4b0b7e
5 changed files with 34 additions and 30 deletions
+9 -4
View File
@@ -128,7 +128,10 @@ import pkg from '../package.json';
/* eslint no-console: 0 */
console.info(
`%c FRIGATE-HASS-CARD \n%c ${localize('common.version')} ${pkg.version} `,
`%c FRIGATE-HASS-CARD \n` +
`%c ${localize('common.version')} ` +
`${pkg.version} ` +
`${process.env.NODE_ENV === 'development' ? `(${pkg['buildDate']})` : ''}`,
'color: pink; font-weight: bold; background: black',
'color: white; font-weight: bold; background: dimgray',
);
@@ -1692,8 +1695,12 @@ export class FrigateCard extends LitElement {
* @returns A combined set of action.
*/
protected _getMergedActions(): Actions {
let specificActions: Actions | undefined = undefined;
if (this._view?.is('timeline')) {
// Timeline does not support actions.
return {};
}
let specificActions: Actions | undefined = undefined;
if (this._view?.is('live')) {
specificActions = this._getConfig().live.actions;
} else if (this._view?.isGalleryView()) {
@@ -1702,8 +1709,6 @@ export class FrigateCard extends LitElement {
specificActions = this._getConfig().media_viewer.actions;
} else if (this._view?.is('image')) {
specificActions = this._getConfig().image?.actions;
} else if (this._view?.is('timeline')) {
specificActions = this._getConfig().timeline?.actions;
}
return { ...this._getConfig().view.actions, ...specificActions };
}