From b7ece5ae00518fa3fe9a9901d1b8b1e5b01307bc Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Thu, 16 Dec 2021 17:27:15 -0500 Subject: [PATCH] Use enums in pvpc_hourly_pricing (#62076) --- homeassistant/components/pvpc_hourly_pricing/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/pvpc_hourly_pricing/sensor.py b/homeassistant/components/pvpc_hourly_pricing/sensor.py index 1000d23b5bf..544c02571c2 100644 --- a/homeassistant/components/pvpc_hourly_pricing/sensor.py +++ b/homeassistant/components/pvpc_hourly_pricing/sensor.py @@ -7,7 +7,7 @@ from typing import Any from aiopvpc import PVPCData -from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity +from homeassistant.components.sensor import SensorEntity, SensorStateClass from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME, CURRENCY_EURO, ENERGY_KILO_WATT_HOUR from homeassistant.core import HomeAssistant, callback @@ -54,7 +54,7 @@ class ElecPriceSensor(RestoreEntity, SensorEntity): _attr_icon = ICON _attr_native_unit_of_measurement = UNIT _attr_should_poll = False - _attr_state_class = STATE_CLASS_MEASUREMENT + _attr_state_class = SensorStateClass.MEASUREMENT def __init__(self, name, unique_id, pvpc_data_handler): """Initialize the sensor object."""