mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +00:00
Update to Togglable entities
This commit is contained in:
parent
18be134ad8
commit
76e67d27e7
@ -86,13 +86,13 @@ class HuiEntitiesCard extends HassLocalizeLitMixin(LitElement)
|
||||
const { show_header_toggle, title } = this.config;
|
||||
const states = this.hass.states;
|
||||
|
||||
const stateEntities = this.configEntities!.filter(
|
||||
const entities = this.configEntities!.filter(
|
||||
(conf) => conf.entity in states
|
||||
);
|
||||
|
||||
const rowEntities = this.configEntities!.filter(
|
||||
(item) => typeof item === "string" || item.entity
|
||||
).map((item) => (typeof item === "string" ? item : item.entity));
|
||||
const toggableEntities = entities
|
||||
.filter((item) => typeof item === "string" || item.entity)
|
||||
.map((item) => (typeof item === "string" ? item : item.entity));
|
||||
|
||||
return html`
|
||||
${this.renderStyle()}
|
||||
@ -109,7 +109,7 @@ class HuiEntitiesCard extends HassLocalizeLitMixin(LitElement)
|
||||
: html`
|
||||
<hui-entities-toggle
|
||||
.hass="${this.hass}"
|
||||
.entities="${rowEntities}"
|
||||
.entities="${toggableEntities}"
|
||||
>
|
||||
</hui-entities-toggle>`
|
||||
}
|
||||
@ -117,7 +117,7 @@ class HuiEntitiesCard extends HassLocalizeLitMixin(LitElement)
|
||||
}
|
||||
<div id="states">
|
||||
${repeat<EntityConfig>(
|
||||
stateEntities,
|
||||
entities,
|
||||
(entityConf) => entityConf.entity,
|
||||
(entityConf) => this.renderEntity(entityConf)
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user