mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Occupancy sensor class (#103)
* Sort the binarySensorIcon cases * Add the occupancy sensor_class
This commit is contained in:
parent
86d61ac9ae
commit
247d951e1e
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user