Allow the image view to trigger a card resize.

This commit is contained in:
Dermot Duffy
2022-06-11 16:28:59 -07:00
parent 8ce65fd72d
commit e9dde20a76
3 changed files with 10 additions and 9 deletions
+5 -5
View File
@@ -658,7 +658,7 @@ export class FrigateCard extends LitElement {
try { try {
entityList = await getAllEntities(this._hass); entityList = await getAllEntities(this._hass);
} catch (e) { } catch (e) {
console.error(e, (e as Error).stack); console.error(e);
} }
const cameras: Map<string, CameraConfig> = new Map(); const cameras: Map<string, CameraConfig> = new Map();
@@ -674,7 +674,7 @@ export class FrigateCard extends LitElement {
try { try {
entity = await getExtendedEntity(this._hass, config.camera_entity, cache); entity = await getExtendedEntity(this._hass, config.camera_entity, cache);
} catch (e) { } catch (e) {
console.error(e, (e as Error).stack); console.error(e);
} }
} }
@@ -704,7 +704,7 @@ export class FrigateCard extends LitElement {
cache, cache,
); );
} catch (e) { } catch (e) {
console.error(e, (e as Error).stack); console.error(e);
} }
if (config.triggers.motion) { if (config.triggers.motion) {
@@ -1167,7 +1167,7 @@ export class FrigateCard extends LitElement {
try { try {
response = await homeAssistantSignPath(this._hass, path); response = await homeAssistantSignPath(this._hass, path);
} catch (e) { } catch (e) {
console.error(e, (e as Error).stack); console.error(e);
} }
if (!response) { if (!response) {
@@ -1608,7 +1608,7 @@ export class FrigateCard extends LitElement {
(screenfull.isEnabled && screenfull.isFullscreen) || (screenfull.isEnabled && screenfull.isFullscreen) ||
aspectRatioMode == 'unconstrained' || aspectRatioMode == 'unconstrained' ||
(aspectRatioMode == 'dynamic' && (aspectRatioMode == 'dynamic' &&
(this._view?.isMediaView() || this._view?.is('timeline'))) || (this._view?.isAnyMediaView() || this._view?.is('timeline'))) ||
this._message != null this._message != null
); );
} }
+1 -1
View File
@@ -108,7 +108,7 @@ export class FrigateCardElementsCore extends LitElement {
try { try {
element.setConfig(config); element.setConfig(config);
} catch (e) { } catch (e) {
console.error(e, (e as Error).stack); console.error(e);
throw new FrigateCardError(localize('error.invalid_elements_config')); throw new FrigateCardError(localize('error.invalid_elements_config'));
} }
return element; return element;
+4 -3
View File
@@ -92,10 +92,11 @@ export class View {
} }
/** /**
* Determine if a view is of a piece of media (i.e. not the gallery). * Determine if a view is of a piece of media (including the media viewer,
* live view, image view -- anything that can create a MediaShowInfo event).
*/ */
public isMediaView(): boolean { public isAnyMediaView(): boolean {
return this.isViewerView() || this.is('live'); return this.isViewerView() || this.is('live') || this.is('image');
} }
/** /**