From 531c3032a94a5946972d749772a725f4f9736cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Ja=CC=88gare=20Lilja?= <> Date: Mon, 27 Mar 2023 17:28:08 +0200 Subject: [PATCH] Fixing State class and device class missmatch #288 --- custom_components/nordpool/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/nordpool/sensor.py b/custom_components/nordpool/sensor.py index a5008dc..03a2786 100644 --- a/custom_components/nordpool/sensor.py +++ b/custom_components/nordpool/sensor.py @@ -12,7 +12,7 @@ from homeassistant.util import dt as dt_utils # Import sensor entity and classes. -from homeassistant.components.sensor import SensorDeviceClass, SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass, SensorEntity from jinja2 import pass_context from . import ( @@ -136,7 +136,7 @@ class NordpoolSensor(SensorEntity): "Sensors data" _attr_device_class = SensorDeviceClass.MONETARY _attr_suggested_display_precision = None - + _attr_state_class = SensorStateClass.TOTAL def __init__( self, friendly_name,