Move temperature conversions to sensor base class (6/8) (#54476)

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

* Fix tests
This commit is contained in:
Erik Montnemery 2021-08-12 17:40:55 +02:00 committed by GitHub
parent 6de6a5dc14
commit e558b3463e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 199 additions and 188 deletions

View file

@ -179,12 +179,12 @@ class SMAsensor(CoordinatorEntity, SensorEntity):
return self._sensor.name
@property
def state(self) -> StateType:
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self._sensor.value
@property
def unit_of_measurement(self) -> str | None:
def native_unit_of_measurement(self) -> str | None:
"""Return the unit the value is expressed in."""
return self._sensor.unit