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:
parent
ae507aeed1
commit
2720ba2753
70 changed files with 195 additions and 183 deletions
|
@ -93,12 +93,12 @@ class LcnVariableSensor(LcnEntity, SensorEntity):
|
|||
await self.device_connection.cancel_status_request_handler(self.variable)
|
||||
|
||||
@property
|
||||
def state(self) -> str | None:
|
||||
def native_value(self) -> str | None:
|
||||
"""Return the state of the entity."""
|
||||
return self._value
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self) -> str:
|
||||
def native_unit_of_measurement(self) -> str:
|
||||
"""Return the unit of measurement of this entity, if any."""
|
||||
return cast(str, self.unit.value)
|
||||
|
||||
|
@ -145,7 +145,7 @@ class LcnLedLogicSensor(LcnEntity, SensorEntity):
|
|||
await self.device_connection.cancel_status_request_handler(self.source)
|
||||
|
||||
@property
|
||||
def state(self) -> str | None:
|
||||
def native_value(self) -> str | None:
|
||||
"""Return the state of the entity."""
|
||||
return self._value
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue