Add icons to Freebox sensors (#30132)
This commit is contained in:
1 parent
4c5801ee8c
commit
f72ba0c716
1 file changed
+14
-10
@@ -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."""
|
||||
|
||||
Reference in new issue
Block a user