Skip to content

Commit

Permalink
Move state_class to class attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
djtimca committed Feb 28, 2023
1 parent 69d4a81 commit 89ff16b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions custom_components/googlewifi/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def __init__(
self.attrs = {}
self._unit_of_measurement = unit_of_measure

_attr_state_class = SensorStateClass.MEASUREMENT

@property
def unique_id(self):
"""Return the unique id for this sensor."""
Expand Down Expand Up @@ -178,11 +180,6 @@ def state(self):
self._state = unit_convert(self._state, self._unit_of_measurement)

return self._state

@property
def state_class(self):
"""Return the state class of total for the sensors."""
return SensorStateClass.MEASUREMENT

@property
def unit_of_measurement(self):
Expand Down

0 comments on commit 89ff16b

Please sign in to comment.