From a27d8570c87e4449769c86ba2bb362872e69a6a7 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Tue, 26 Nov 2019 19:12:00 +0100 Subject: [PATCH] Move imports to top for unifi_direct (#29106) --- homeassistant/components/unifi_direct/device_tracker.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/unifi_direct/device_tracker.py b/homeassistant/components/unifi_direct/device_tracker.py index a526cc926d3..558a9981171 100644 --- a/homeassistant/components/unifi_direct/device_tracker.py +++ b/homeassistant/components/unifi_direct/device_tracker.py @@ -1,16 +1,17 @@ """Support for Unifi AP direct access.""" -import logging import json +import logging +from pexpect import exceptions, pxssh import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner, ) -from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_PORT +from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME +import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -74,7 +75,6 @@ class UnifiDeviceScanner(DeviceScanner): def _connect(self): """Connect to the Unifi AP SSH server.""" - from pexpect import pxssh, exceptions self.ssh = pxssh.pxssh() try: @@ -98,7 +98,6 @@ class UnifiDeviceScanner(DeviceScanner): self.connected = False def _get_update(self): - from pexpect import pxssh, exceptions try: if not self.connected: