mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix unit of measurement for asuswrt sensors (#44009)
This commit is contained in:
parent
035860ebb2
commit
84973ec8f7
@ -29,7 +29,7 @@ class _SensorTypes(enum.Enum):
|
|||||||
UPLOAD_SPEED = "upload_speed"
|
UPLOAD_SPEED = "upload_speed"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit(self) -> Optional[str]:
|
def unit_of_measurement(self) -> Optional[str]:
|
||||||
"""Return a string with the unit of the sensortype."""
|
"""Return a string with the unit of the sensortype."""
|
||||||
if self in (_SensorTypes.UPLOAD, _SensorTypes.DOWNLOAD):
|
if self in (_SensorTypes.UPLOAD, _SensorTypes.DOWNLOAD):
|
||||||
return DATA_GIGABYTES
|
return DATA_GIGABYTES
|
||||||
@ -161,3 +161,8 @@ class AsuswrtSensor(CoordinatorEntity):
|
|||||||
def icon(self) -> Optional[str]:
|
def icon(self) -> Optional[str]:
|
||||||
"""Return the icon to use in the frontend."""
|
"""Return the icon to use in the frontend."""
|
||||||
return self._type.icon
|
return self._type.icon
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unit_of_measurement(self) -> Optional[str]:
|
||||||
|
"""Return the unit of measurement of this entity, if any."""
|
||||||
|
return self._type.unit_of_measurement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user