Skip to content
Snippets Groups Projects
Commit f72ba0c7 authored by Quentame's avatar Quentame Committed by Aaron Bach
Browse files

Add icons to Freebox sensors (#30132)

parent 4c5801ee
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ class FbxSensor(Entity):
"""Representation of a freebox sensor."""
_name = "generic"
_unit = None
_icon = None
def __init__(self, fbx):
"""Initialize the sensor."""
......@@ -30,6 +32,16 @@ class FbxSensor(Entity):
"""Return the name of the sensor."""
return self._name
@property
def unit_of_measurement(self):
"""Return the unit of the sensor."""
return self._unit
@property
def icon(self):
"""Return the icon of the sensor."""
return self._icon
@property
def state(self):
"""Return the state of the sensor."""
......@@ -45,11 +57,7 @@ class FbxRXSensor(FbxSensor):
_name = "Freebox download speed"
_unit = "KB/s"
@property
def unit_of_measurement(self):
"""Define the unit."""
return self._unit
_icon = "mdi:download-network"
async def async_update(self):
"""Get the value from fetched datas."""
......@@ -63,11 +71,7 @@ class FbxTXSensor(FbxSensor):
_name = "Freebox upload speed"
_unit = "KB/s"
@property
def unit_of_measurement(self):
"""Define the unit."""
return self._unit
_icon = "mdi:upload-network"
async def async_update(self):
"""Get the value from fetched datas."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment