Occupancy sensor class (#103)

* Sort the binarySensorIcon cases

* Add the occupancy sensor_class
This commit is contained in:
Robbie Trencheny 2016-09-03 21:56:12 -07:00 committed by Teagan Glenn
parent 86d61ac9ae
commit 247d951e1e

View File

@ -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';
}