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%; + } `, ]; }