Fix group more-info to show the state of the group entity (#17052)

This commit is contained in:
karwosts 2023-06-27 07:54:18 -07:00 committed by GitHub
parent 87aad75cc7
commit 3111c29049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,8 @@ class MoreInfoGroup extends LitElement {
return;
}
const baseStateObj = states.find((s) => s.state === "on") || states[0];
const baseStateObj =
states.find((s) => s.state === this.stateObj!.state) || states[0];
const groupDomain = computeGroupDomain(this.stateObj);
@ -56,6 +57,8 @@ class MoreInfoGroup extends LitElement {
this._groupDomainStateObj = {
...baseStateObj,
entity_id: this.stateObj.entity_id,
last_updated: this.stateObj.last_updated,
last_changed: this.stateObj.last_changed,
attributes: {
...baseStateObj.attributes,
friendly_name: this.stateObj.attributes.friendly_name,