From 247d951e1ee6c22705be591867225f3df954869b Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sat, 3 Sep 2016 21:56:12 -0700 Subject: [PATCH] Occupancy sensor class (#103) * Sort the binarySensorIcon cases * Add the occupancy sensor_class --- src/util/hass-util.html | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 4da4b6043a..8760aa19cc 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -299,26 +299,27 @@ window.hassUtil.domainIcon = function (domain, state) { window.hassUtil.binarySensorIcon = function (state) { var activated = state.state && state.state === 'off'; switch (state.attributes.sensor_class) { - case 'opening': - return activated ? 'mdi:crop-square' : 'mdi:exit-to-app'; - case 'moisture': - return activated ? 'mdi:water-off' : 'mdi:water'; + case 'connectivity': + return activated ? 'mdi:server-network-off' : 'mdi:server-network'; case 'light': return activated ? 'mdi:brightness-5' : 'mdi:brightness-7'; + case 'moisture': + return activated ? 'mdi:water-off' : 'mdi:water'; + case 'motion': + return activated ? 'mdi:walk' : 'mdi:run'; + case 'occupancy': + return activated ? 'mdi:home' : 'mdi:home-outline'; + case 'opening': + return activated ? 'mdi:crop-square' : 'mdi:exit-to-app'; case 'sound': return activated ? 'mdi:music-note-off' : 'mdi:music-note'; case 'vibration': return activated ? 'mdi:crop-portrait' : 'mdi:vibrate'; - case 'connectivity': - return activated ? 'mdi:server-network-off' : 'mdi:server-network'; - case 'safety': case 'gas': - case 'smoke': case 'power': + case 'safety': + case 'smoke': return activated ? 'mdi:verified' : 'mdi:alert'; - case 'motion': - return activated ? 'mdi:walk' : 'mdi:run'; - case 'digital': default: return activated ? 'mdi:radiobox-blank' : 'mdi:checkbox-marked-circle'; }