diff --git a/src/translations/en.json b/src/translations/en.json index 87ec2b591a..40dec286ca 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -83,14 +83,30 @@ "off": "Normal", "on": "Low" }, + "cold": { + "off": "[%key:state::binary_sensor::battery::off%]", + "on": "Cold" + }, "connectivity": { "off": "Disconnected", "on": "Connected" }, + "door": { + "off": "[%key:state::binary_sensor::opening::off%]", + "on": "[%key:state::binary_sensor::opening::on%]" + }, + "garage_door": { + "off": "[%key:state::binary_sensor::opening::off%]", + "on": "[%key:state::binary_sensor::opening::on%]" + }, "gas": { "off": "Clear", "on": "Detected" }, + "heat": { + "off": "[%key:state::binary_sensor::battery::off%]", + "on": "Hot" + }, "moisture": { "off": "Dry", "on": "Wet" @@ -130,6 +146,10 @@ "vibration": { "off": "[%key:state::binary_sensor::gas::off%]", "on": "[%key:state::binary_sensor::gas::on%]" + }, + "window": { + "off": "[%key:state::binary_sensor::opening::off%]", + "on": "[%key:state::binary_sensor::opening::on%]" } }, "calendar": { diff --git a/src/util/hass-attributes-util.html b/src/util/hass-attributes-util.html index 935cc22884..af74b3b97c 100644 --- a/src/util/hass-attributes-util.html +++ b/src/util/hass-attributes-util.html @@ -3,9 +3,29 @@ window.hassAttributeUtil = window.hassAttributeUtil || {}; window.hassAttributeUtil.DOMAIN_DEVICE_CLASS = { binary_sensor: [ - 'battery', 'cold', 'connectivity', 'gas', 'heat', 'light', 'moisture', - 'motion', 'moving', 'occupancy', 'opening', 'plug', 'power', 'presence', - 'safety', 'smoke', 'sound', 'vibration'], + 'battery', + 'cold', + 'connectivity', + 'door', + 'garage_door', + 'gas', + 'heat', + 'light', + 'moisture', + 'motion', + 'moving', + 'occupancy', + 'opening', + 'plug', + 'power', + 'presence', + 'problem', + 'safety', + 'smoke', + 'sound', + 'vibration', + 'window' + ], cover: ['garage'], }; diff --git a/src/util/hass-util.html b/src/util/hass-util.html index cd6ab0ed87..5f7a13af16 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -207,8 +207,22 @@ window.hassUtil.binarySensorIcon = function (state) { switch (state.attributes.device_class) { case 'battery': return activated ? 'mdi:battery' : 'mdi:battery-outline'; + case 'cold': + return activated ? 'mdi:thermometer' : 'mdi:snowflake'; case 'connectivity': return activated ? 'mdi:server-network-off' : 'mdi:server-network'; + case 'door': + return activated ? 'mdi:door-closed' : 'mdi:door-open'; + case 'garage_door': + return activated ? 'mdi:garage' : 'mdi:garage-open'; + case 'gas': + case 'power': + case 'problem': + case 'safety': + case 'smoke': + return activated ? 'mdi:verified' : 'mdi:alert'; + case 'heat': + return activated ? 'mdi:thermometer' : 'mdi:fire'; case 'light': return activated ? 'mdi:brightness-5' : 'mdi:brightness-7'; case 'moisture': @@ -218,21 +232,17 @@ window.hassUtil.binarySensorIcon = function (state) { case 'occupancy': return activated ? 'mdi:home' : 'mdi:home-outline'; case 'opening': - return activated ? 'mdi:door-closed' : 'mdi:door-open'; - case 'sound': - return activated ? 'mdi:music-note-off' : 'mdi:music-note'; - case 'vibration': - return activated ? 'mdi:crop-portrait' : 'mdi:vibrate'; - case 'gas': - case 'power': - case 'problem': - case 'safety': - case 'smoke': - return activated ? 'mdi:verified' : 'mdi:alert'; + return activated ? 'mdi:square' : 'mdi:square-outline'; case 'plug': return activated ? 'mdi:power-plug-off' : 'mdi:power-plug'; case 'presence': return activated ? 'mdi:home-outline' : 'mdi:home'; + case 'sound': + return activated ? 'mdi:music-note-off' : 'mdi:music-note'; + case 'vibration': + return activated ? 'mdi:crop-portrait' : 'mdi:vibrate'; + case 'window': + return activated ? 'mdi:window-closed' : 'mdi:window-open'; default: return activated ? 'mdi:radiobox-blank' : 'mdi:checkbox-marked-circle'; }