Move esphome imports at top-level (#29064)

This commit is contained in:
Quentame authored and Paulus Schoutsen committed 2019-11-25 18:00:58 -08:00
1 parent 87de5db535
commit 8a413b152d
6 files changed
+16 -30

No files matched your search

@@ -2,6 +2,7 @@
from collections import OrderedDict
from typing import Optional
from aioesphomeapi import APIClient, APIConnectionError
import voluptuous as vol
from homeassistant import config_entries
@@ -147,8 +148,6 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
async def fetch_device_info(self):
"""Fetch device info from API and return any errors."""
from aioesphomeapi import APIClient, APIConnectionError
cli = APIClient(self.hass.loop, self._host, self._port, "")
try:
@@ -165,8 +164,6 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
async def try_login(self):
"""Try logging in to device and return any errors."""
from aioesphomeapi import APIClient, APIConnectionError
cli = APIClient(self.hass.loop, self._host, self._port, self._password)
try: