diff --git a/src/translations/en.json b/src/translations/en.json index d5c84192df..24a085ecec 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -114,6 +114,10 @@ "off": "[%key:state::binary_sensor::battery::off%]", "on": "Hot" }, + "lock": { + "off": "[%key:state::lock::locked%]", + "on": "[%key:state::lock::unlocked%]" + }, "moisture": { "off": "Dry", "on": "Wet" diff --git a/src/util/hass-attributes-util.html b/src/util/hass-attributes-util.html index af74b3b97c..3d50b73f97 100644 --- a/src/util/hass-attributes-util.html +++ b/src/util/hass-attributes-util.html @@ -11,6 +11,7 @@ window.hassAttributeUtil.DOMAIN_DEVICE_CLASS = { 'gas', 'heat', 'light', + 'lock', 'moisture', 'motion', 'moving', diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 85fad2da3a..a408016e57 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -242,6 +242,8 @@ window.hassUtil.binarySensorIcon = function (state) { return activated ? 'mdi:thermometer' : 'mdi:fire'; case 'light': return activated ? 'mdi:brightness-5' : 'mdi:brightness-7'; + case 'lock': + return activated ? 'mdi:lock' : 'mdi:lock-open'; case 'moisture': return activated ? 'mdi:water-off' : 'mdi:water'; case 'motion':