mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +00:00
Updating from reviews
This commit is contained in:
parent
4c3db2119b
commit
33578a6289
@ -49,8 +49,8 @@ export class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
|
||||
};
|
||||
}
|
||||
|
||||
public getCardSize() {
|
||||
return 3;
|
||||
public getCardSize() {
|
||||
return (this.config!.title ? 1 : 0) + Math.ceil(this.configEntities!.length / 5);
|
||||
}
|
||||
|
||||
public setConfig(config: Config) {
|
||||
@ -89,11 +89,7 @@ export class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
|
||||
${this.renderStyle()}
|
||||
<ha-card .header="${title}">
|
||||
<div class="entities ${classMap({ "no-header": !title })}">
|
||||
${repeat<EntityConfig>(
|
||||
this.configEntities!,
|
||||
(entityConf) => entityConf.entity,
|
||||
(entityConf) => this.renderEntity(entityConf)
|
||||
)}
|
||||
${this.configEntities!.map(entityConf => this.renderEntity(entityConf))}
|
||||
</div>
|
||||
</ha-card>
|
||||
`;
|
||||
@ -145,9 +141,9 @@ export class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
|
||||
const stateObj = this.hass!.states[entityConf.entity];
|
||||
|
||||
if (!stateObj) {
|
||||
return html`<div class="entity not-found">Entity Not Available: ${
|
||||
return html`<div class="entity not-found"><div class="name">${
|
||||
entityConf.entity
|
||||
}</div>`;
|
||||
}</div>Entity Not Available</div>`;
|
||||
}
|
||||
|
||||
return html`
|
||||
|
Loading…
x
Reference in New Issue
Block a user