From e19663f172d54314455b9ebf19500ddd5f7eb4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diefferson=20Koderer=20M=C3=B4ro?= Date: Mon, 21 Oct 2019 04:58:22 -0300 Subject: [PATCH] Move imports in lirc component (#28015) --- homeassistant/components/lirc/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/lirc/__init__.py b/homeassistant/components/lirc/__init__.py index 47814d00e9a..bfc8e455624 100644 --- a/homeassistant/components/lirc/__init__.py +++ b/homeassistant/components/lirc/__init__.py @@ -1,12 +1,13 @@ """Support for LIRC devices.""" # pylint: disable=no-member, import-error +import logging import threading import time -import logging +import lirc import voluptuous as vol -from homeassistant.const import EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_START +from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP _LOGGER = logging.getLogger(__name__) @@ -23,8 +24,6 @@ CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA) def setup(hass, config): """Set up the LIRC capability.""" - import lirc - # blocking=True gives unexpected behavior (multiple responses for 1 press) # also by not blocking, we allow hass to shut down the thread gracefully # on exit. @@ -61,8 +60,6 @@ class LircInterface(threading.Thread): def run(self): """Run the loop of the LIRC interface thread.""" - import lirc - _LOGGER.debug("LIRC interface thread started") while not self.stopped.isSet(): try: