diff --git a/homeassistant/components/freebox/sensor.py b/homeassistant/components/freebox/sensor.py index e8f9658630066f9aff400f57a54cb68e44c3f42f..61ec670d217ef8eea923c3f989d67fcb7b85605e 100644 --- a/homeassistant/components/freebox/sensor.py +++ b/homeassistant/components/freebox/sensor.py @@ -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."""