Introduced a new device class "plug" for the binary sensor. (#558)

* Introduced a new device class "plug" for the binary sensor.

See https://github.com/home-assistant/home-assistant-polymer/issues/550

* removed plug as domain
This commit is contained in:
Simon 2017-11-05 19:23:57 +01:00 committed by Paulus Schoutsen
parent 9b0f4fa234
commit ba5f401890
2 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,7 @@ window.hassAttributeUtil.DOMAIN_DEVICE_CLASS = {
binary_sensor: [
'connectivity', 'light', 'moisture', 'motion', 'occupancy', 'opening',
'sound', 'vibration', 'gas', 'power', 'safety', 'smoke', 'cold', 'heat',
'moving'],
'moving', 'plug'],
cover: ['garage'],
};

View File

@ -385,6 +385,8 @@ window.hassUtil.binarySensorIcon = function (state) {
case 'safety':
case 'smoke':
return activated ? 'mdi:verified' : 'mdi:alert';
case 'plug':
return activated ? 'mdi:power-plug-off' : 'mdi:power-plug';
default:
return activated ? 'mdi:radiobox-blank' : 'mdi:checkbox-marked-circle';
}
@ -497,6 +499,7 @@ window.hassUtil.computeStateState = function (stateObj) {
case 'light':
case 'moving':
case 'power':
case 'plug':
default:
}
} else if (domain === 'input_datetime') {