Move imports to top for unifi_direct ()

pull/29113/head^2
springstan 2019-11-26 19:12:00 +01:00 committed by Paulus Schoutsen
parent 4119ade2af
commit a27d8570c8
1 changed files with 4 additions and 5 deletions
homeassistant/components/unifi_direct

View File

@ -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: