Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
deprication warning with 2024.1 for several constants
  • Loading branch information
ChristophCaina authored Dec 31, 2023
1 parent d1592f2 commit 88afd83
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions custom_components/daikin_residential_altherma/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

from homeassistant.components.sensor import (
SensorEntity,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorStateClass,
)

from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -404,7 +403,7 @@ def state(self):

@property
def state_class(self):
return STATE_CLASS_MEASUREMENT
return SensorStateClass.MEASUREMENT

class DaikinClimateSensor(DaikinSensor):
"""Representation of a Climate Sensor."""
Expand All @@ -416,7 +415,7 @@ def state(self):

@property
def state_class(self):
return STATE_CLASS_MEASUREMENT
return SensorStateClass.MEASUREMENT

class DaikinEnergySensor(DaikinSensor):
"""Representation of a power/energy consumption sensor."""
Expand All @@ -437,7 +436,7 @@ def state(self):

@property
def state_class(self):
return STATE_CLASS_TOTAL_INCREASING
return SensorStateClass.TOTAL_INCREASING

class DaikinGatewaySensor(DaikinSensor):
"""Representation of a WiFi Sensor."""
Expand All @@ -453,7 +452,7 @@ def state(self):
@property
def state_class(self):
if self._device_attribute == ATTR_WIFI_STRENGTH:
return STATE_CLASS_MEASUREMENT
return SensorStateClass.MEASUREMENT
else:
return None

Expand Down

0 comments on commit 88afd83

Please sign in to comment.