diff --git a/src/translations/en.json b/src/translations/en.json index 8bdc07a0b8..7db7e06935 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -37,14 +37,18 @@ "off": "[%key:state::default::off%]", "on": "[%key:state::default::on%]" }, - "moisture": { - "off": "Dry", - "on": "Wet" + "battery": { + "off": "Normal", + "on": "Low" }, "gas": { "off": "Clear", "on": "Detected" }, + "moisture": { + "off": "Dry", + "on": "Wet" + }, "motion": { "off": "[%key:state::binary_sensor::gas::off%]", "on": "[%key:state::binary_sensor::gas::on%]" @@ -53,18 +57,6 @@ "off": "[%key:state::binary_sensor::gas::off%]", "on": "[%key:state::binary_sensor::gas::on%]" }, - "smoke": { - "off": "[%key:state::binary_sensor::gas::off%]", - "on": "[%key:state::binary_sensor::gas::on%]" - }, - "sound": { - "off": "[%key:state::binary_sensor::gas::off%]", - "on": "[%key:state::binary_sensor::gas::on%]" - }, - "vibration": { - "off": "[%key:state::binary_sensor::gas::off%]", - "on": "[%key:state::binary_sensor::gas::on%]" - }, "opening": { "off": "Closed", "on": "Open" @@ -76,6 +68,18 @@ "safety": { "off": "Safe", "on": "Unsafe" + }, + "smoke": { + "off": "[%key:state::binary_sensor::gas::off%]", + "on": "[%key:state::binary_sensor::gas::on%]" + }, + "sound": { + "off": "[%key:state::binary_sensor::gas::off%]", + "on": "[%key:state::binary_sensor::gas::on%]" + }, + "vibration": { + "off": "[%key:state::binary_sensor::gas::off%]", + "on": "[%key:state::binary_sensor::gas::on%]" } }, "calendar": { diff --git a/src/util/hass-attributes-util.html b/src/util/hass-attributes-util.html index ed22ceb34d..935cc22884 100644 --- a/src/util/hass-attributes-util.html +++ b/src/util/hass-attributes-util.html @@ -3,9 +3,9 @@ window.hassAttributeUtil = window.hassAttributeUtil || {}; window.hassAttributeUtil.DOMAIN_DEVICE_CLASS = { binary_sensor: [ - 'connectivity', 'light', 'moisture', 'motion', 'occupancy', 'opening', - 'sound', 'vibration', 'gas', 'power', 'safety', 'smoke', 'cold', 'heat', - 'moving', 'plug', 'presence'], + 'battery', 'cold', 'connectivity', 'gas', 'heat', 'light', 'moisture', + 'motion', 'moving', 'occupancy', 'opening', 'plug', 'power', 'presence', + 'safety', 'smoke', 'sound', 'vibration'], cover: ['garage'], }; diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 7e486d3091..3c5afcac2b 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -205,6 +205,8 @@ window.hassUtil.domainIcon = function (domain, state) { window.hassUtil.binarySensorIcon = function (state) { var activated = state.state && state.state === 'off'; switch (state.attributes.device_class) { + case 'battery': + return activated ? 'mdi:battery' : 'mdi:battery-outline'; case 'connectivity': return activated ? 'mdi:server-network-off' : 'mdi:server-network'; case 'light':