Merge pull request #34 from w1ll1am23/display_offline

Display a different entity icon if device is unavailable
This commit is contained in:
Paulus Schoutsen 2016-03-12 10:17:19 -08:00
commit 8187b8d964
2 changed files with 10 additions and 1 deletions

View File

@ -59,7 +59,8 @@ export default new Polymer({
computeIsOn(stateObj) {
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

View File

@ -27,6 +27,14 @@
ha-state-icon[data-domain=sun][data-state=above_horizon] {
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>
<template>