Skip to content

Commit

Permalink
Add icons for upload/download sensors for asuswrt (#35581)
Browse files Browse the repository at this point in the history
  • Loading branch information
bskaplou authored May 14, 2020
1 parent d0d9b4d commit 37cabe5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions homeassistant/components/asuswrt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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."""
Expand All @@ -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."""
Expand All @@ -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."""
Expand All @@ -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."""
Expand Down

0 comments on commit 37cabe5

Please sign in to comment.