mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Merge pull request #34 from w1ll1am23/display_offline
Display a different entity icon if device is unavailable
This commit is contained in:
commit
8187b8d964
@ -59,7 +59,8 @@ export default new Polymer({
|
|||||||
|
|
||||||
computeIsOn(stateObj) {
|
computeIsOn(stateObj) {
|
||||||
return stateObj && stateObj.state !== 'off' &&
|
return stateObj && stateObj.state !== 'off' &&
|
||||||
stateObj.state !== 'unlocked' && stateObj.state !== 'closed';
|
stateObj.state !== 'unlocked' && stateObj.state !== 'closed' &&
|
||||||
|
stateObj.state !== 'unavailable';
|
||||||
},
|
},
|
||||||
|
|
||||||
// We call updateToggle after a successful call to re-sync the toggle
|
// We call updateToggle after a successful call to re-sync the toggle
|
||||||
|
@ -27,6 +27,14 @@
|
|||||||
ha-state-icon[data-domain=sun][data-state=above_horizon] {
|
ha-state-icon[data-domain=sun][data-state=above_horizon] {
|
||||||
color: #DCC91F;
|
color: #DCC91F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Color the icon if unavailable */
|
||||||
|
ha-state-icon[data-domain=light][data-state=unavailable],
|
||||||
|
ha-state-icon[data-domain=switch][data-state=unavailable],
|
||||||
|
ha-state-icon[data-domain=binary_sensor][data-state=unavailable],
|
||||||
|
ha-state-icon[data-domain=sensor][data-state=unavailable] {
|
||||||
|
color: #D3D3D3;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user