mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Plant add name (#2130)
This commit is contained in:
parent
ffc7f9706d
commit
8757dbb664
@ -103,6 +103,7 @@ class HaPlantCard extends EventsMixin(PolymerElement) {
|
|||||||
return {
|
return {
|
||||||
hass: Object,
|
hass: Object,
|
||||||
stateObj: Object,
|
stateObj: Object,
|
||||||
|
config: Object,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ class HaPlantCard extends EventsMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
computeTitle(stateObj) {
|
computeTitle(stateObj) {
|
||||||
return computeStateName(stateObj);
|
return this.config.name || computeStateName(stateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
computeAttributes(data) {
|
computeAttributes(data) {
|
||||||
|
@ -34,6 +34,7 @@ export default class LegacyWrapperCard extends HTMLElement {
|
|||||||
this._ensureElement(this._tag);
|
this._ensureElement(this._tag);
|
||||||
this.lastChild.hass = hass;
|
this.lastChild.hass = hass;
|
||||||
this.lastChild.stateObj = hass.states[entityId];
|
this.lastChild.stateObj = hass.states[entityId];
|
||||||
|
this.lastChild.config = this._config;
|
||||||
} else {
|
} else {
|
||||||
this._ensureElement("HUI-ERROR-CARD");
|
this._ensureElement("HUI-ERROR-CARD");
|
||||||
this.lastChild.setConfig(
|
this.lastChild.setConfig(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user