Move temperature conversions to entity base class (7/8) (#54482)
This commit is contained in:
parent
41f3c2766c
commit
94a264afaf
54 changed files with 153 additions and 153 deletions
|
@ -69,7 +69,7 @@ class StarlineSensor(StarlineEntity, SensorEntity):
|
|||
return self._icon
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def native_value(self):
|
||||
"""Return the state of the sensor."""
|
||||
if self._key == "battery":
|
||||
return self._device.battery_level
|
||||
|
@ -90,7 +90,7 @@ class StarlineSensor(StarlineEntity, SensorEntity):
|
|||
return None
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
def native_unit_of_measurement(self):
|
||||
"""Get the unit of measurement."""
|
||||
if self._key == "balance":
|
||||
return self._device.balance.get("currency") or "₽"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue