mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Move imports to top for unifi_direct (#29106)
This commit is contained in:
parent
4119ade2af
commit
a27d8570c8
@ -1,16 +1,17 @@
|
|||||||
"""Support for Unifi AP direct access."""
|
"""Support for Unifi AP direct access."""
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from pexpect import exceptions, pxssh
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
DeviceScanner,
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -74,7 +75,6 @@ class UnifiDeviceScanner(DeviceScanner):
|
|||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
"""Connect to the Unifi AP SSH server."""
|
"""Connect to the Unifi AP SSH server."""
|
||||||
from pexpect import pxssh, exceptions
|
|
||||||
|
|
||||||
self.ssh = pxssh.pxssh()
|
self.ssh = pxssh.pxssh()
|
||||||
try:
|
try:
|
||||||
@ -98,7 +98,6 @@ class UnifiDeviceScanner(DeviceScanner):
|
|||||||
self.connected = False
|
self.connected = False
|
||||||
|
|
||||||
def _get_update(self):
|
def _get_update(self):
|
||||||
from pexpect import pxssh, exceptions
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not self.connected:
|
if not self.connected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user