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
|
@ -568,7 +568,7 @@ class SmartThingsPowerConsumptionSensor(SmartThingsEntity, SensorEntity):
|
|||
return f"{self._device.device_id}.{self.report_name}"
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def native_value(self):
|
||||
"""Return the state of the sensor."""
|
||||
value = self._device.status.attributes[Attribute.power_consumption].value
|
||||
if value is None or value.get(self.report_name) is None:
|
||||
|
@ -585,7 +585,7 @@ class SmartThingsPowerConsumptionSensor(SmartThingsEntity, SensorEntity):
|
|||
return DEVICE_CLASS_ENERGY
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
def native_unit_of_measurement(self):
|
||||
"""Return the unit this state is expressed in."""
|
||||
if self.report_name == "power":
|
||||
return POWER_WATT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue