Fix some sensor classes (#48254)

* Fix some sensor classes

* Tweak

* Tweak
This commit is contained in:
Erik Montnemery 2021-03-23 15:56:33 +01:00 committed by GitHub
parent 6932cf9534
commit a09c8eecb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 88 additions and 61 deletions

View file

@ -35,3 +35,8 @@ class WithingsHealthSensor(BaseWithingsSensor, SensorEntity):
def state(self) -> None | str | int | float:
"""Return the state of the entity."""
return self._state_data
@property
def unit_of_measurement(self) -> str:
"""Return the unit of measurement of this entity, if any."""
return self._attribute.unit_of_measurement