Move Arduino imports (#27438)

This commit is contained in:
Paolo Tuninetto 2019-10-11 17:52:38 +02:00 committed by Fabian Affolter
parent 8bbf261302
commit 618cf5fa04

View File

@ -1,8 +1,11 @@
"""Support for Arduino boards running with the Firmata firmware.""" """Support for Arduino boards running with the Firmata firmware."""
import logging import logging
import serial
import voluptuous as vol import voluptuous as vol
from PyMata.pymata import PyMata
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.const import CONF_PORT from homeassistant.const import CONF_PORT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
@ -20,7 +23,6 @@ CONFIG_SCHEMA = vol.Schema(
def setup(hass, config): def setup(hass, config):
"""Set up the Arduino component.""" """Set up the Arduino component."""
import serial
port = config[DOMAIN][CONF_PORT] port = config[DOMAIN][CONF_PORT]
@ -59,7 +61,6 @@ class ArduinoBoard:
def __init__(self, port): def __init__(self, port):
"""Initialize the board.""" """Initialize the board."""
from PyMata.pymata import PyMata
self._port = port self._port = port
self._board = PyMata(self._port, verbose=False) self._board = PyMata(self._port, verbose=False)