mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Fix more-info dialog call for groups of entities having a common domain (#1698)
This commit is contained in:
parent
3f15cbd2bd
commit
7cec39ba6c
@ -6,7 +6,6 @@ import '../../../state-summary/state-card-content.js';
|
|||||||
|
|
||||||
import computeStateDomain from '../../../common/entity/compute_state_domain';
|
import computeStateDomain from '../../../common/entity/compute_state_domain';
|
||||||
import dynamicContentUpdater from '../../../common/dom/dynamic_content_updater.js';
|
import dynamicContentUpdater from '../../../common/dom/dynamic_content_updater.js';
|
||||||
import stateMoreInfoType from '../../../common/entity/state_more_info_type.js';
|
|
||||||
|
|
||||||
class MoreInfoGroup extends PolymerElement {
|
class MoreInfoGroup extends PolymerElement {
|
||||||
static get template() {
|
static get template() {
|
||||||
@ -70,10 +69,11 @@ class MoreInfoGroup extends PolymerElement {
|
|||||||
|
|
||||||
statesChanged(stateObj, states) {
|
statesChanged(stateObj, states) {
|
||||||
let groupDomainStateObj = false;
|
let groupDomainStateObj = false;
|
||||||
|
let groupDomain = false;
|
||||||
|
|
||||||
if (states && states.length > 0) {
|
if (states && states.length > 0) {
|
||||||
const baseStateObj = states.find(s => s.state === 'on') || states[0];
|
const baseStateObj = states.find(s => s.state === 'on') || states[0];
|
||||||
const groupDomain = computeStateDomain(baseStateObj);
|
groupDomain = computeStateDomain(baseStateObj);
|
||||||
|
|
||||||
// Groups need to be filtered out or we'll show content of
|
// Groups need to be filtered out or we'll show content of
|
||||||
// first child above the children of the current group
|
// first child above the children of the current group
|
||||||
@ -100,7 +100,7 @@ class MoreInfoGroup extends PolymerElement {
|
|||||||
} else {
|
} else {
|
||||||
dynamicContentUpdater(
|
dynamicContentUpdater(
|
||||||
this.$.groupedControlDetails,
|
this.$.groupedControlDetails,
|
||||||
'MORE-INFO-' + stateMoreInfoType(groupDomainStateObj).toUpperCase(),
|
'MORE-INFO-' + groupDomain.toUpperCase(),
|
||||||
{ stateObj: groupDomainStateObj, hass: this.hass }
|
{ stateObj: groupDomainStateObj, hass: this.hass }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user