mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Add icons for upload/download sensors for asuswrt (#35581)
This commit is contained in:
parent
d0d9b4df78
commit
37cabe5562
@ -10,6 +10,9 @@ from . import DATA_ASUSWRT
|
||||
|
||||
_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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user