separated mikrotik_controller

pylint cleanup
This commit is contained in:
tomaae 2019-12-02 04:19:40 +01:00
parent fbf1c112b3
commit c24f49252a
6 changed files with 299 additions and 271 deletions

View file

@ -6,17 +6,16 @@ from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.components.device_tracker.const import SOURCE_TYPE_ROUTER
from homeassistant.const import (
CONF_NAME,
ATTR_ATTRIBUTION,
)
from .const import (
DOMAIN,
DATA_CLIENT,
ATTRIBUTION,
)
from homeassistant.const import (
CONF_NAME,
ATTR_ATTRIBUTION,
)
_LOGGER = logging.getLogger(__name__)
DEVICE_ATTRIBUTES = [
@ -144,6 +143,7 @@ class MikrotikControllerPortDeviceTracker(ScannerEntity):
"""Return the icon."""
if not self.mikrotik_controller.data['interface'][self._uid]['enabled']:
return 'mdi:lan-disconnect'
if self.mikrotik_controller.data['interface'][self._uid]['running']:
return 'mdi:lan-connect'
else: