From bf8a33e086f54ade28c4f8d8a0e14ca09ad54d18 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 27 Feb 2024 12:50:37 +0100 Subject: [PATCH] Fix button card and sensor card in grid section (#19887) --- src/panels/lovelace/cards/hui-button-card.ts | 4 ++-- src/panels/lovelace/cards/hui-sensor-card.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index 129390fe5b..2d440a3036 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -149,8 +149,8 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { public getGridSize(): [number, number] { if ( - (this._config?.show_icon && this._config?.show_name) || - this._config?.show_state + this._config?.show_icon && + (this._config?.show_name || this._config?.show_state) ) { return [2, 2]; } diff --git a/src/panels/lovelace/cards/hui-sensor-card.ts b/src/panels/lovelace/cards/hui-sensor-card.ts index d90858862d..709a6591d9 100644 --- a/src/panels/lovelace/cards/hui-sensor-card.ts +++ b/src/panels/lovelace/cards/hui-sensor-card.ts @@ -72,7 +72,7 @@ class HuiSensorCard extends HuiEntityCard { super.setConfig(entityCardConfig); } - public getSize(): [number, number] { + public getGridSize(): [number, number] { return [2, 2]; }