From 4dfdebb00a772da5501d846a4305dda276354e13 Mon Sep 17 00:00:00 2001 From: Markus Jankowski Date: Thu, 4 Apr 2019 06:55:14 +0200 Subject: [PATCH] Add device_class_power to sensor (#3057) --- src/common/entity/sensor_icon.ts | 1 + src/util/hass-attributes-util.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/entity/sensor_icon.ts b/src/common/entity/sensor_icon.ts index d08f7c6e97..de741888b7 100644 --- a/src/common/entity/sensor_icon.ts +++ b/src/common/entity/sensor_icon.ts @@ -8,6 +8,7 @@ const fixedDeviceClassIcons = { illuminance: "hass:brightness-5", temperature: "hass:thermometer", pressure: "hass:gauge", + power: "hass:flash", }; export default function sensorIcon(state: HassEntity) { diff --git a/src/util/hass-attributes-util.js b/src/util/hass-attributes-util.js index 5afcc6f8ff..4740fea291 100644 --- a/src/util/hass-attributes-util.js +++ b/src/util/hass-attributes-util.js @@ -27,7 +27,14 @@ hassAttributeUtil.DOMAIN_DEVICE_CLASS = { "window", ], cover: ["garage"], - sensor: ["battery", "humidity", "illuminance", "temperature", "pressure"], + sensor: [ + "battery", + "humidity", + "illuminance", + "temperature", + "pressure", + "power", + ], }; hassAttributeUtil.UNKNOWN_TYPE = "json";