diff --git a/custom_components/octopus_energy/sensor.py b/custom_components/octopus_energy/sensor.py index 34904963..64bc624d 100644 --- a/custom_components/octopus_energy/sensor.py +++ b/custom_components/octopus_energy/sensor.py @@ -7,11 +7,9 @@ DataUpdateCoordinator ) from homeassistant.components.sensor import ( - DEVICE_CLASS_MONETARY, - DEVICE_CLASS_ENERGY, - DEVICE_CLASS_GAS, - STATE_CLASS_TOTAL_INCREASING, + SensorDeviceClass, SensorEntity, + SensorStateClass ) from homeassistant.const import ( ENERGY_KILO_WATT_HOUR, @@ -206,7 +204,7 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_MONETARY + return SensorDeviceClass.MONETARY @property def icon(self): @@ -284,7 +282,7 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_MONETARY + return SensorDeviceClass.MONETARY @property def icon(self): @@ -358,12 +356,12 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_ENERGY + return SensorDeviceClass.ENERGY @property def state_class(self): """The state class of sensor""" - return STATE_CLASS_TOTAL_INCREASING + return SensorStateClass.TOTAL_INCREASING @property def unit_of_measurement(self): @@ -432,12 +430,12 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_MONETARY + return SensorDeviceClass.MONETARY @property def state_class(self): """The state class of sensor""" - return STATE_CLASS_TOTAL_INCREASING + return SensorStateClass.TOTAL_INCREASING @property def unit_of_measurement(self): @@ -545,7 +543,7 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_MONETARY + return SensorDeviceClass.MONETARY @property def icon(self): @@ -624,12 +622,12 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_GAS + return SensorDeviceClass.GAS @property def state_class(self): """The state class of sensor""" - return STATE_CLASS_TOTAL_INCREASING + return SensorStateClass.TOTAL_INCREASING @property def unit_of_measurement(self): @@ -698,12 +696,12 @@ def name(self): @property def device_class(self): """The type of sensor""" - return DEVICE_CLASS_MONETARY + return SensorDeviceClass.MONETARY @property def state_class(self): """The state class of sensor""" - return STATE_CLASS_TOTAL_INCREASING + return SensorStateClass.TOTAL_INCREASING @property def unit_of_measurement(self):