mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +00:00
Fix group more-info not updating (#622)
* Fix group more-info not updating * Remove old observer
This commit is contained in:
parent
a4bcf062d5
commit
675a7a3b86
@ -25,34 +25,32 @@ class MoreInfoContent extends Polymer.Element {
|
|||||||
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
hass: {
|
hass: Object,
|
||||||
type: Object,
|
stateObj: Object,
|
||||||
},
|
|
||||||
|
|
||||||
stateObj: {
|
|
||||||
type: Object,
|
|
||||||
observer: 'stateObjChanged',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get observers() {
|
||||||
|
return [
|
||||||
|
'stateObjChanged(stateObj, hass)',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.style.display = 'block';
|
this.style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
stateObjChanged(stateObj) {
|
stateObjChanged(stateObj, hass) {
|
||||||
var rootEl;
|
if (!stateObj || !hass) {
|
||||||
if (!stateObj) {
|
|
||||||
// If root has lastChild, set 'isVisible' attribute of that child to false.
|
// If root has lastChild, set 'isVisible' attribute of that child to false.
|
||||||
rootEl = Polymer.dom(this);
|
if (this.lastChild) {
|
||||||
if (rootEl.lastChild) {
|
this.lastChild.isVisible = false;
|
||||||
rootEl.lastChild.isVisible = false;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.hassUtil.dynamicContentUpdater(
|
window.hassUtil.dynamicContentUpdater(
|
||||||
this, 'MORE-INFO-' + window.hassUtil.stateMoreInfoType(stateObj).toUpperCase(),
|
this, 'MORE-INFO-' + window.hassUtil.stateMoreInfoType(stateObj).toUpperCase(),
|
||||||
{ hass: this.hass, stateObj: stateObj, isVisible: true }
|
{ hass: hass, stateObj: stateObj, isVisible: true }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user