From 8dab7c598eb069f78ca233bf5e97208fad0026d6 Mon Sep 17 00:00:00 2001 From: ildar170975 <71872483+ildar170975@users.noreply.github.com> Date: Mon, 24 Mar 2025 12:43:47 +0300 Subject: [PATCH] Logbook card: fix height in Panel view (#24745) * fix height in Panel * Update src/panels/lovelace/cards/hui-logbook-card.ts Co-authored-by: Paul Bottein * prettier --------- Co-authored-by: Paul Bottein --- src/panels/lovelace/cards/hui-logbook-card.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/panels/lovelace/cards/hui-logbook-card.ts b/src/panels/lovelace/cards/hui-logbook-card.ts index b01c25ed28..12ee971d1f 100644 --- a/src/panels/lovelace/cards/hui-logbook-card.ts +++ b/src/panels/lovelace/cards/hui-logbook-card.ts @@ -52,6 +52,8 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ attribute: false }) public layout?: string; + @state() private _config?: LogbookCardConfig; @state() private _time?: HaLogbook["time"]; @@ -139,6 +141,13 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { resolveEntityIDs(this.hass, targetPickerValue, entities, devices, areas) ); + protected update(changedProperties) { + super.update(changedProperties); + if (changedProperties.has("layout")) { + this.toggleAttribute("ispanel", this.layout === "panel"); + } + } + protected updated(changedProperties: PropertyValues) { super.updated(changedProperties); if (!this._config || !this.hass) { @@ -214,6 +223,11 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { height: 385px; display: block; } + + :host([ispanel]) .content, + :host([ispanel]) ha-logbook { + height: 100%; + } `, ]; }