From 3122182ab2015c34472f3d67b618e95d48b9b69a Mon Sep 17 00:00:00 2001 From: Quentame Date: Mon, 25 Nov 2019 14:05:07 +0100 Subject: [PATCH] Move edimax imports at top-level (#29053) --- homeassistant/components/edimax/switch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/edimax/switch.py b/homeassistant/components/edimax/switch.py index f1d8f8046ef..3d558f6c770 100644 --- a/homeassistant/components/edimax/switch.py +++ b/homeassistant/components/edimax/switch.py @@ -1,9 +1,10 @@ """Support for Edimax switches.""" import logging +from pyedimax.smartplug import SmartPlug import voluptuous as vol -from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA +from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME import homeassistant.helpers.config_validation as cv @@ -25,8 +26,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Find and return Edimax Smart Plugs.""" - from pyedimax.smartplug import SmartPlug - host = config.get(CONF_HOST) auth = (config.get(CONF_USERNAME), config.get(CONF_PASSWORD)) name = config.get(CONF_NAME)