Move Arduino imports (#27438)

pull/27093/head
Paolo Tuninetto 2019-10-11 17:52:38 +02:00 committed by Fabian Affolter
parent 8bbf261302
commit 618cf5fa04
1 changed files with 3 additions and 2 deletions

View File

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