mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-27 20:46:38 +00:00
Allows to define a custom "more info" dialog per entity (#1128)
This commit is contained in:
parent
30555eda88
commit
3e90db5fa3
@ -43,6 +43,7 @@ class MoreInfoContent extends Polymer.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stateObjChanged(stateObj, hass) {
|
stateObjChanged(stateObj, hass) {
|
||||||
|
let moreInfoType;
|
||||||
if (!stateObj || !hass) {
|
if (!stateObj || !hass) {
|
||||||
if (this.lastChild) {
|
if (this.lastChild) {
|
||||||
this._detachedChild = this.lastChild;
|
this._detachedChild = this.lastChild;
|
||||||
@ -55,8 +56,13 @@ class MoreInfoContent extends Polymer.Element {
|
|||||||
this.appendChild(this._detachedChild);
|
this.appendChild(this._detachedChild);
|
||||||
this._detachedChild = null;
|
this._detachedChild = null;
|
||||||
}
|
}
|
||||||
|
if (stateObj.attributes && 'custom_ui_more_info' in stateObj.attributes) {
|
||||||
|
moreInfoType = stateObj.attributes.custom_ui_more_info;
|
||||||
|
} else {
|
||||||
|
moreInfoType = 'more-info-' + window.hassUtil.stateMoreInfoType(stateObj);
|
||||||
|
}
|
||||||
window.hassUtil.dynamicContentUpdater(
|
window.hassUtil.dynamicContentUpdater(
|
||||||
this, 'MORE-INFO-' + window.hassUtil.stateMoreInfoType(stateObj).toUpperCase(),
|
this, moreInfoType.toUpperCase(),
|
||||||
{ hass: hass, stateObj: stateObj }
|
{ hass: hass, stateObj: stateObj }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ window.hassAttributeUtil.LOGIC_STATE_ATTRIBUTES =
|
|||||||
homebridge_name: { type: 'string' },
|
homebridge_name: { type: 'string' },
|
||||||
supported_features: undefined,
|
supported_features: undefined,
|
||||||
attribution: undefined,
|
attribution: undefined,
|
||||||
|
custom_ui_more_info: { type: 'string' },
|
||||||
custom_ui_state_card: { type: 'string' },
|
custom_ui_state_card: { type: 'string' },
|
||||||
device_class: {
|
device_class: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user