"""
Support for controlling raspihats boards.

For more details about this component, please refer to the documentation at
https://home-assistant.io/components/raspihats/
"""
# pylint: disable=import-error,no-name-in-module
import logging
import threading
import time

from homeassistant.const import (
    EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)

REQUIREMENTS = ['raspihats==2.2.3', 'smbus-cffi==0.5.1']

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'raspihats'

CONF_I2C_HATS = 'i2c_hats'
CONF_BOARD = 'board'
CONF_ADDRESS = 'address'
CONF_CHANNELS = 'channels'
CONF_INDEX = 'index'
CONF_INVERT_LOGIC = 'invert_logic'
CONF_INITIAL_STATE = 'initial_state'

I2C_HAT_NAMES = [
    'Di16', 'Rly10', 'Di6Rly6',
    'DI16ac', 'DQ10rly', 'DQ16oc', 'DI6acDQ6rly'
]

I2C_HATS_MANAGER = 'I2CH_MNG'


def setup(hass, config):
    """Set up the raspihats component."""