From 9299f0a8b21a05d0212afd02a9d2781fa294b6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Sat, 10 Oct 2020 14:20:15 +0200 Subject: [PATCH] Add device_class to Tibber sensor (#41572) --- homeassistant/components/tibber/sensor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index c5484f90838..5043819b823 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -6,6 +6,7 @@ from random import randrange import aiohttp +from homeassistant.components.sensor import DEVICE_CLASS_POWER from homeassistant.const import POWER_WATT from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers.entity import Entity @@ -235,3 +236,8 @@ class TibberSensorRT(TibberSensor): def unique_id(self): """Return a unique ID.""" return f"{self.device_id}_rt_consumption" + + @property + def device_class(self): + """Return the device class of the sensor.""" + return DEVICE_CLASS_POWER