From 37cabe556289e31c95cc7eb39d9b97f00e7c9f1c Mon Sep 17 00:00:00 2001 From: Boris Kaplounovsky Date: Fri, 15 May 2020 00:06:33 +0300 Subject: [PATCH] Add icons for upload/download sensors for asuswrt (#35581) --- homeassistant/components/asuswrt/sensor.py | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/homeassistant/components/asuswrt/sensor.py b/homeassistant/components/asuswrt/sensor.py index 631e6e9d70f5fa..cbe32a1ec433bd 100644 --- a/homeassistant/components/asuswrt/sensor.py +++ b/homeassistant/components/asuswrt/sensor.py @@ -10,6 +10,9 @@ _LOGGER = logging.getLogger(__name__) +UPLOAD_ICON = "mdi:upload-network" +DOWNLOAD_ICON = "mdi:download-network" + async def async_setup_platform(hass, config, add_entities, discovery_info=None): """Set up the asuswrt sensors.""" @@ -82,6 +85,11 @@ class AsuswrtRXSensor(AsuswrtSensor): _name = "Asuswrt Download Speed" _unit = DATA_RATE_MEGABITS_PER_SECOND + @property + def icon(self): + """Return the icon.""" + return DOWNLOAD_ICON + @property def unit_of_measurement(self): """Return the unit of measurement.""" @@ -100,6 +108,11 @@ class AsuswrtTXSensor(AsuswrtSensor): _name = "Asuswrt Upload Speed" _unit = DATA_RATE_MEGABITS_PER_SECOND + @property + def icon(self): + """Return the icon.""" + return UPLOAD_ICON + @property def unit_of_measurement(self): """Return the unit of measurement.""" @@ -118,6 +131,11 @@ class AsuswrtTotalRXSensor(AsuswrtSensor): _name = "Asuswrt Download" _unit = DATA_GIGABYTES + @property + def icon(self): + """Return the icon.""" + return DOWNLOAD_ICON + @property def unit_of_measurement(self): """Return the unit of measurement.""" @@ -136,6 +154,11 @@ class AsuswrtTotalTXSensor(AsuswrtSensor): _name = "Asuswrt Upload" _unit = DATA_GIGABYTES + @property + def icon(self): + """Return the icon.""" + return UPLOAD_ICON + @property def unit_of_measurement(self): """Return the unit of measurement."""