From b14787566f53388d02942bc11553724a2532bb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Tue, 30 Oct 2018 14:12:17 +0100 Subject: [PATCH] Fix calculation of size of glance card --- src/panels/lovelace/cards/hui-glance-card.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index a2eb7b67032b..594effabfa0a 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -51,8 +51,11 @@ export class HuiGlanceCard extends hassLocalizeLitMixin(LitElement) } public getCardSize() { + const columns = + this.config!.columns || Math.min(this.config!.entities.length, 5); return ( - (this.config!.title ? 1 : 0) + Math.ceil(this.configEntities!.length / 5) + (this.config!.title ? 1 : 0) + + 2 * Math.ceil(this.configEntities!.length / columns) ); }