Add 'lock' device class (#800)

* Add 'lock' device class

* Invert lock settings as per https://github.com/home-assistant/home-assistant/pull/11640
This commit is contained in:
Sean Wilson 2018-02-28 16:25:33 -05:00 committed by Paulus Schoutsen
parent bb6c46180d
commit 7377db312b
3 changed files with 7 additions and 0 deletions

View File

@ -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"

View File

@ -11,6 +11,7 @@ window.hassAttributeUtil.DOMAIN_DEVICE_CLASS = {
'gas',
'heat',
'light',
'lock',
'moisture',
'motion',
'moving',

View File

@ -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':