From bdd8699709d3c38466b5e5bd81298e8bc4e71e11 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Fri, 19 Apr 2019 00:12:17 +0200 Subject: [PATCH] Add device_class for switches (#3096) --- src/util/hass-attributes-util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/hass-attributes-util.js b/src/util/hass-attributes-util.js index b9757e9638..e6d6a7e322 100644 --- a/src/util/hass-attributes-util.js +++ b/src/util/hass-attributes-util.js @@ -46,6 +46,7 @@ hassAttributeUtil.DOMAIN_DEVICE_CLASS = { "power", "signal_strength", ], + switch: ["switch", "outlet"], }; hassAttributeUtil.UNKNOWN_TYPE = "json"; @@ -88,7 +89,7 @@ hassAttributeUtil.LOGIC_STATE_ATTRIBUTES = hassAttributeUtil.LOGIC_STATE_ATTRIBU type: "array", options: hassAttributeUtil.DOMAIN_DEVICE_CLASS, description: "Device class", - domains: ["binary_sensor", "cover", "sensor"], + domains: ["binary_sensor", "cover", "sensor", "switch"], }, hidden: { type: "boolean", description: "Hide from UI" }, assumed_state: {