mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 10:56:34 +00:00
Picture Entity to use name instead of titles (#1388)
Entities have names, states have titles.
This commit is contained in:
parent
e452384ecd
commit
173cd8126c
@ -55,7 +55,7 @@ class HuiPictureEntityCard extends LocalizeMixin(PolymerElement) {
|
|||||||
entity="[[_config.entity]]"
|
entity="[[_config.entity]]"
|
||||||
></hui-image>
|
></hui-image>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div id="title"></div>
|
<div id="name"></div>
|
||||||
<div id="state"></div>
|
<div id="state"></div>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@ -101,7 +101,7 @@ class HuiPictureEntityCard extends LocalizeMixin(PolymerElement) {
|
|||||||
_updateState(hass, entityId, config) {
|
_updateState(hass, entityId, config) {
|
||||||
const state = entityId in hass.states ? hass.states[entityId].state : UNAVAILABLE;
|
const state = entityId in hass.states ? hass.states[entityId].state : UNAVAILABLE;
|
||||||
|
|
||||||
this.$.title.innerText = config.title || (state === UNAVAILABLE ?
|
this.$.name.innerText = config.name || (state === UNAVAILABLE ?
|
||||||
entityId : computeStateName(hass.states[entityId]));
|
entityId : computeStateName(hass.states[entityId]));
|
||||||
this.$.state.innerText = state === UNAVAILABLE ?
|
this.$.state.innerText = state === UNAVAILABLE ?
|
||||||
UNAVAILABLE : this._computeState(hass.states[entityId]);
|
UNAVAILABLE : this._computeState(hass.states[entityId]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user