Plant add name (#2130)

This commit is contained in:
Zack Arnett 2018-11-27 14:22:53 -05:00 committed by Paulus Schoutsen
parent ffc7f9706d
commit 8757dbb664
2 changed files with 3 additions and 1 deletions

View File

@ -103,6 +103,7 @@ class HaPlantCard extends EventsMixin(PolymerElement) {
return {
hass: Object,
stateObj: Object,
config: Object,
};
}
@ -118,7 +119,7 @@ class HaPlantCard extends EventsMixin(PolymerElement) {
}
computeTitle(stateObj) {
return computeStateName(stateObj);
return this.config.name || computeStateName(stateObj);
}
computeAttributes(data) {

View File

@ -34,6 +34,7 @@ export default class LegacyWrapperCard extends HTMLElement {
this._ensureElement(this._tag);
this.lastChild.hass = hass;
this.lastChild.stateObj = hass.states[entityId];
this.lastChild.config = this._config;
} else {
this._ensureElement("HUI-ERROR-CARD");
this.lastChild.setConfig(