Move temperature conversions to sensor base class (4/8) (#54472)

* Move temperature conversions to entity base class (4/8)

* Fix litterrobot sensor

* Fix tests
This commit is contained in:
Erik Montnemery 2021-08-11 21:17:47 +02:00 committed by GitHub
parent ae507aeed1
commit 2720ba2753
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 195 additions and 183 deletions

View file

@ -124,7 +124,7 @@ class KrakenSensor(CoordinatorEntity, SensorEntity):
return self._name.lower()
@property
def state(self) -> StateType:
def native_value(self) -> StateType:
"""Return the state."""
return self._state
@ -229,7 +229,7 @@ class KrakenSensor(CoordinatorEntity, SensorEntity):
return "mdi:cash"
@property
def unit_of_measurement(self) -> str | None:
def native_unit_of_measurement(self) -> str | None:
"""Return the unit the value is expressed in."""
if "number_of" not in self._sensor_type:
return self._unit_of_measurement