Move temperature conversions to sensor base class - new integrations (#54623)
* Move temperature conversions to sensor base class * Tweaks * Update pvpc_hourly_pricing * Fix flipr sensor * Fix ezviz and youless sensor
This commit is contained in:
parent
a9807e5fa7
commit
87e7a8fb5f
17 changed files with 60 additions and 58 deletions
|
@ -136,7 +136,7 @@ class FritzBoxPowerSensor(FritzBoxSensor):
|
|||
"""The entity class for FRITZ!SmartHome power consumption sensors."""
|
||||
|
||||
@property
|
||||
def state(self) -> float | None:
|
||||
def native_value(self) -> float | None:
|
||||
"""Return the state of the sensor."""
|
||||
if power := self.device.power:
|
||||
return power / 1000 # type: ignore [no-any-return]
|
||||
|
@ -147,7 +147,7 @@ class FritzBoxEnergySensor(FritzBoxSensor):
|
|||
"""The entity class for FRITZ!SmartHome total energy sensors."""
|
||||
|
||||
@property
|
||||
def state(self) -> float | None:
|
||||
def native_value(self) -> float | None:
|
||||
"""Return the state of the sensor."""
|
||||
if energy := self.device.energy:
|
||||
return energy / 1000 # type: ignore [no-any-return]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue