From 84973ec8f795be0553e5112867f7eb54ecf6154b Mon Sep 17 00:00:00 2001 From: JJdeVries <43748187+JJdeVries@users.noreply.github.com> Date: Mon, 7 Dec 2020 12:46:53 +0100 Subject: [PATCH] Fix unit of measurement for asuswrt sensors (#44009) --- homeassistant/components/asuswrt/sensor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/asuswrt/sensor.py b/homeassistant/components/asuswrt/sensor.py index 15ca58a525f..aa13bee81d0 100644 --- a/homeassistant/components/asuswrt/sensor.py +++ b/homeassistant/components/asuswrt/sensor.py @@ -29,7 +29,7 @@ class _SensorTypes(enum.Enum): UPLOAD_SPEED = "upload_speed" @property - def unit(self) -> Optional[str]: + def unit_of_measurement(self) -> Optional[str]: """Return a string with the unit of the sensortype.""" if self in (_SensorTypes.UPLOAD, _SensorTypes.DOWNLOAD): return DATA_GIGABYTES @@ -161,3 +161,8 @@ class AsuswrtSensor(CoordinatorEntity): def icon(self) -> Optional[str]: """Return the icon to use in the frontend.""" 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