Fix calculation of glance card size (#1930)

This commit is contained in:
Thomas Lovén 2018-10-30 15:57:08 +01:00 committed by GitHub
parent 2e395c1b0d
commit a081047008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
);
}