fixed device tracker disabled icon

This commit is contained in:
tomaae 2019-12-03 01:47:07 +01:00
parent 0a45a072e8
commit a4c4b344b7

View file

@ -141,12 +141,14 @@ class MikrotikControllerPortDeviceTracker(ScannerEntity):
@property
def icon(self):
"""Return the icon."""
icon = 'mdi:lan-disconnect'
if self.mikrotik_controller.data['interface'][self._uid]['running']:
icon = 'mdi:lan-connect'
else:
icon = 'mdi:lan-pending'
if not self.mikrotik_controller.data['interface'][self._uid]['enabled']:
icon = 'mdi:lan-disconnect'
return icon
@property