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

@ -59,7 +59,7 @@ class IncomfortSensor(IncomfortChild, SensorEntity):
self._unit_of_measurement = None
@property
def state(self) -> str | None:
def native_value(self) -> str | None:
"""Return the state of the sensor."""
return self._heater.status[self._state_attr]
@ -69,7 +69,7 @@ class IncomfortSensor(IncomfortChild, SensorEntity):
return self._device_class
@property
def unit_of_measurement(self) -> str | None:
def native_unit_of_measurement(self) -> str | None:
"""Return the unit of measurement of the sensor."""
return self._unit_of_measurement