From ba5f401890c8f4c60abbf3dfb774396be791e67f Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 5 Nov 2017 19:23:57 +0100 Subject: [PATCH] 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 --- src/util/hass-attributes-util.html | 2 +- src/util/hass-util.html | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/hass-attributes-util.html b/src/util/hass-attributes-util.html index e17d821d3b84..f2b0817aa7c8 100644 --- a/src/util/hass-attributes-util.html +++ b/src/util/hass-attributes-util.html @@ -5,7 +5,7 @@ binary_sensor: [ 'connectivity', 'light', 'moisture', 'motion', 'occupancy', 'opening', 'sound', 'vibration', 'gas', 'power', 'safety', 'smoke', 'cold', 'heat', - 'moving'], + 'moving', 'plug'], cover: ['garage'], }; diff --git a/src/util/hass-util.html b/src/util/hass-util.html index be5c8bf2257c..a98e61018643 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -385,6 +385,8 @@ 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 @@ case 'light': case 'moving': case 'power': + case 'plug': default: } } else if (domain === 'input_datetime') {