Ejemplo n.º 1
0
TYPE_STANDARD = "standard"
TYPE_INVERTED = "inverted"

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICE_DEFAULTS, default=DEVICE_DEFAULTS_SCHEMA({})):
    DEVICE_DEFAULTS_SCHEMA,
    vol.Optional(CONF_DEVICES, default={}):
    vol.Schema({
        cv.string: {
            vol.Optional(CONF_NAME):
            cv.string,
            vol.Optional(CONF_TYPE):
            vol.Any(TYPE_STANDARD, TYPE_INVERTED),
            vol.Optional(CONF_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_GROUP_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_NOGROUP_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_FIRE_EVENT, default=False):
            cv.boolean,
            vol.Optional(CONF_SIGNAL_REPETITIONS):
            vol.Coerce(int),
            vol.Optional(CONF_GROUP, default=True):
            cv.boolean,
        }
    }),
})


def entity_type_for_device_id(device_id):
Ejemplo n.º 2
0
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_validation as cv

from . import (CONF_AUTOMATIC_ADD, CONF_DEVICES, CONF_FIRE_EVENT,
               CONF_SIGNAL_REPETITIONS, DEFAULT_SIGNAL_REPETITIONS)

DEPENDENCIES = ['rfxtrx']

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICES, default={}): {
        cv.string:
        vol.Schema({
            vol.Required(CONF_NAME): cv.string,
            vol.Optional(CONF_FIRE_EVENT, default=False): cv.boolean
        })
    },
    vol.Optional(CONF_AUTOMATIC_ADD, default=False):
    cv.boolean,
    vol.Optional(CONF_SIGNAL_REPETITIONS, default=DEFAULT_SIGNAL_REPETITIONS):
    vol.Coerce(int),
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the RFXtrx cover."""
    import RFXtrx as rfxtrxmod

    covers = rfxtrx.get_devices_from_config(config, RfxtrxCover)
    add_entities(covers)
Ejemplo n.º 3
0
    STATE_CLOSING,
    STATE_OPENING,
)
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from .const import NOTIFICATION_ID, NOTIFICATION_TITLE, STATES_MAP, SUPPORTED_FEATURES
from .model import DoorDevice

_LOGGER: Final = logging.getLogger(__name__)

PLATFORM_SCHEMA: Final = BASE_PLATFORM_SCHEMA.extend({
    vol.Required(CONF_USERNAME):
    cv.string,
    vol.Required(CONF_PASSWORD):
    cv.string
})


def setup_platform(
    hass: HomeAssistant,
    config: ConfigType,
    add_entities: AddEntitiesCallback,
    discovery_info: DiscoveryInfoType | None = None,
) -> None:
    """Set up the Aladdin Connect platform."""

    username: str = config[CONF_USERNAME]
    password: str = config[CONF_PASSWORD]
    acc = AladdinConnectClient(username, password)
Ejemplo n.º 4
0
)
from .gateway import MyHOMEGateway
from OWNd.message import (
    OWNAutomationEvent,
    OWNAutomationCommand,
)

MYHOME_SCHEMA = vol.Schema({
    vol.Required(CONF_WHERE): cv.string,
    vol.Optional(CONF_NAME): cv.string,
    vol.Optional(CONF_ADVANCED_SHUTTER): cv.boolean,
    vol.Optional(CONF_MANUFACTURER): cv.string,
    vol.Optional(CONF_DEVICE_MODEL): cv.string,
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {vol.Required(CONF_DEVICES): cv.schema_with_slug_keys(MYHOME_SCHEMA)})

_LOGGER = logging.getLogger(__name__)


async def async_setup_platform(hass,
                               config,
                               async_add_entities,
                               discovery_info=None):
    devices = config.get(CONF_DEVICES)
    try:
        gateway = hass.data[DOMAIN][CONF_GATEWAY]

        if devices:
            for _, entity_info in devices.items():
                name = entity_info[
Ejemplo n.º 5
0
    vol.Optional(CONF_COMMAND_CLOSE, default=None):
    cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME):
    cv.string,
    vol.Optional(CONF_TRAVEL_TIME, default=None):
    cv.positive_int,
    #    vol.Optional(CONF_POS_SENSOR, default=None): cv.entity_id,
    vol.Optional(CONF_POS_SENSOR, ):
    cv.entity_id,
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_COVERS, default={}):
    vol.Schema({cv.slug: COVERS_SCHEMA}),
    vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT):
    cv.positive_int,
    vol.Required(CONF_HOST):
    cv.string,
    vol.Required(CONF_MAC):
    cv.string,
})


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):

    import broadlink

    devices = config.get(CONF_COVERS)
    ip_addr = config.get(CONF_HOST)
    mac_addr = binascii.unhexlify(
        config.get(CONF_MAC).encode().replace(b':', b''))
Ejemplo n.º 6
0
    "closing": STATE_CLOSING,
    "stopped": STATE_STOPPED
}


# Validation of the user's configuration
COVER_SCHEMA = vol.Schema({
    vol.Optional(CONF_DEVICE): cv.string,
    vol.Optional(CONF_USERNAME): cv.string,
    vol.Optional(CONF_PASSWORD): cv.string,
    vol.Optional(CONF_ACCESS_TOKEN): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS): vol.Schema({cv.slug: COVER_SCHEMA}),
})

_LOGGER = logging.getLogger(__name__)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Demo covers."""
    covers = []
    devices = config.get(CONF_COVERS, {})

    _LOGGER.debug(devices)

    for device_id, device_config in devices.items():
        args = {
            "name": device_config.get(CONF_NAME),
Ejemplo n.º 7
0
"""Support for SCSGate covers."""
import logging

import voluptuous as vol

from homeassistant.components import scsgate
from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_DEVICES, CONF_NAME)
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

DEPENDENCIES = ['scsgate']

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_DEVICES):
        cv.schema_with_slug_keys(scsgate.SCSGATE_SCHEMA),
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the SCSGate cover."""
    devices = config.get(CONF_DEVICES)
    covers = []
    logger = logging.getLogger(__name__)

    if devices:
        for _, entity_info in devices.items():
            if entity_info[scsgate.CONF_SCS_ID] in scsgate.SCSGATE.devices:
                continue

            name = entity_info[CONF_NAME]
Ejemplo n.º 8
0
    MYQ_DEVICE_TYPE,
    MYQ_DEVICE_TYPE_GATE,
    MYQ_GATEWAY,
    MYQ_TO_HASS,
    TRANSITION_COMPLETE_DURATION,
    TRANSITION_START_DURATION,
)

_LOGGER = logging.getLogger(__name__)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {
        vol.Required(CONF_USERNAME):
        cv.string,
        vol.Required(CONF_PASSWORD):
        cv.string,
        # This parameter is no longer used; keeping it to avoid a breaking change in
        # a hotfix, but in a future main release, this should be removed:
        vol.Optional(CONF_TYPE):
        cv.string,
    }, )


async def async_setup_platform(hass,
                               config,
                               async_add_entities,
                               discovery_info=None):
    """Set up the platform."""

    hass.async_create_task(
        hass.config_entries.flow.async_init(
Ejemplo n.º 9
0
    API_CLOUD,
    API_LOCAL,
    ATTR_TOUCHGO,
    CONF_INVERT_POSITION,
    DEFAULT_OFFSET,
    DOMAIN,
    SLIDES,
    SLIDES_LOCAL,
)

_LOGGER = logging.getLogger(__name__)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {
        vol.Optional(CONF_HOST): cv.string,
        vol.Optional(CONF_PASSWORD): cv.string,
        vol.Optional(CONF_INVERT_POSITION, default=False): cv.boolean,
    },
    extra=vol.ALLOW_EXTRA,
)


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up cover(s) for Slide platform."""

    if discovery_info is None:
        # Local
        if DOMAIN not in hass.data:
            hass.data[DOMAIN] = {}

        if API_LOCAL not in hass.data[DOMAIN]:
            hass.data[DOMAIN][API_LOCAL] = GoSlideLocal()
Ejemplo n.º 10
0
import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.components.cover import (
    CoverDevice, DEVICE_CLASS_SHADE, SUPPORT_OPEN, SUPPORT_CLOSE,
    SUPPORT_SET_POSITION, ATTR_POSITION, PLATFORM_SCHEMA)

_LOGGER = logging.getLogger(__name__)

#TODO Should be moved to homeassistant.const
CONF_WEBCONTROL_SERVER_ADDR = 'webcontrol_server_addr'
CONF_UPDATE_INTERVAL = 'update_interval'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_WEBCONTROL_SERVER_ADDR, default='http://webcontrol.local'): cv.url,
    vol.Optional(CONF_UPDATE_INTERVAL, default=600): cv.positive_int
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    from warema_wms import Shade, WmsController
    shades = Shade.get_all_shades(WmsController(config[CONF_WEBCONTROL_SERVER_ADDR]), time_between_cmds=0.5)
    add_devices(WaremaShade(s, config[CONF_UPDATE_INTERVAL]) for s in shades)


class WaremaShade(CoverDevice):
    """Represents a warema shade"""

    def __init__(self, shade, update_interval: int):
        self.shade = shade
        self.room = shade.get_room_name()
Ejemplo n.º 11
0
            CONF_MOTOR_FAULT: cv.positive_int,
            CONF_RED_LED: cv.positive_int,
            CONF_GREEN_LED: cv.positive_int,
            CONF_ENCODER_LED: cv.positive_int,
            CONF_ENCODER_DETECTOR: cv.positive_int,
            CONF_POSITION_UPPER: cv.positive_int,
            # CONF_POSITION_UPPER_MODE: cv.positive_int,
            CONF_POSITION_BOTTOM: cv.positive_int,
            # CONF_POSITION_BOTTOM_MODE: cv.positive_int,
        })
    ],
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS):
    _COVERS_SCHEMA,
    # vol.Optional(CONF_STATE_PULL_MODE, default=DEFAULT_STATE_PULL_MODE): cv.string,
})


async def async_setup_platform(hass,
                               config,
                               async_add_entities,
                               discovery_info=None):
    """Set up the RPi cover platform."""
    _LOGGER.warning("Setup WIESZOK platform")
    covers_conf = config.get(CONF_COVERS)
    # pull_mode = config.get(CONF_STATE_PULL_MODE)
    covers = []
    for cover in covers_conf:
        motor = Motor(dir_pin=cover[CONF_MOTOR_DIR],
Ejemplo n.º 12
0
            "piid": 1
        },
        "current_position": {
            "siid": 2,
            "piid": 2
        },
        "target_position": {
            "siid": 2,
            "piid": 2
        },
    },
}

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_NAME): cv.string,
    vol.Required(CONF_HOST): cv.string,
    vol.Required(CONF_TOKEN): cv.string,
    vol.Required(CONF_MODEL): cv.string,
})


def setup_platform(hass, config, add_devices_callback, discovery_info=None):
    name = config.get(CONF_NAME)
    host = config.get(CONF_HOST)
    token = config.get(CONF_TOKEN)
    model = config.get(CONF_MODEL)
    cover = DooyaCurtain(name, host, token, model)
    add_devices_callback([cover])


class DooyaCurtain(CoverEntity):
    def __init__(self, name, host, token, model):
Ejemplo n.º 13
0
DEFAULT_NAME = "ADS Cover"

CONF_ADS_VAR_SET_POS = "adsvar_set_position"
CONF_ADS_VAR_OPEN = "adsvar_open"
CONF_ADS_VAR_CLOSE = "adsvar_close"
CONF_ADS_VAR_STOP = "adsvar_stop"

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_ADS_VAR):
    cv.string,
    vol.Optional(CONF_ADS_VAR_POSITION):
    cv.string,
    vol.Optional(CONF_ADS_VAR_SET_POS):
    cv.string,
    vol.Optional(CONF_ADS_VAR_CLOSE):
    cv.string,
    vol.Optional(CONF_ADS_VAR_OPEN):
    cv.string,
    vol.Optional(CONF_ADS_VAR_STOP):
    cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME):
    cv.string,
    vol.Optional(CONF_DEVICE_CLASS):
    DEVICE_CLASSES_SCHEMA,
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the cover platform for ADS."""
    ads_hub = hass.data[DATA_ADS]

    ads_var_is_closed = config.get(CONF_ADS_VAR)
Ejemplo n.º 14
0
    SERVICE_SET_COVER_POSITION, SERVICE_SET_COVER_TILT_POSITION,
    SERVICE_STOP_COVER, SERVICE_STOP_COVER_TILT, SUPPORT_CLOSE,
    SUPPORT_CLOSE_TILT, SUPPORT_OPEN, SUPPORT_OPEN_TILT, SUPPORT_SET_POSITION,
    SUPPORT_SET_TILT_POSITION, SUPPORT_STOP, SUPPORT_STOP_TILT, CoverDevice)

_LOGGER = logging.getLogger(__name__)

KEY_OPEN_CLOSE = 'open_close'
KEY_STOP = 'stop'
KEY_POSITION = 'position'

DEFAULT_NAME = 'Cover Group'


PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
    vol.Required(CONF_ENTITIES): cv.entities_domain(DOMAIN),
})


async def async_setup_platform(hass, config, async_add_entities,
                               discovery_info=None):
    """Set up the Group Cover platform."""
    async_add_entities(
        [CoverGroup(config[CONF_NAME], config[CONF_ENTITIES])])


class CoverGroup(CoverDevice):
    """Representation of a CoverGroup."""

    def __init__(self, name, entities):
        """Initialize a CoverGroup entity."""
Ejemplo n.º 15
0
)
from homeassistant.helpers import aiohttp_client, config_validation as cv

_LOGGER = logging.getLogger(__name__)

MYQ_TO_HASS = {
    "closed": STATE_CLOSED,
    "closing": STATE_CLOSING,
    "open": STATE_OPEN,
    "opening": STATE_OPENING,
}

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_TYPE):
    cv.string,
    vol.Required(CONF_USERNAME):
    cv.string,
    vol.Required(CONF_PASSWORD):
    cv.string,
})


async def async_setup_platform(hass,
                               config,
                               async_add_entities,
                               discovery_info=None):
    """Set up the platform."""
    from pymyq import login
    from pymyq.errors import MyQError, UnsupportedBrandError

    websession = aiohttp_client.async_get_clientsession(hass)
Ejemplo n.º 16
0
    ATTR_MODEL,
    ATTR_FIRMWARE_VERSION,
    ATTR_HARDWARE_VERSION,
    SCHEMA,
)

_LOGGER = logging.getLogger(__name__)

DEFAULT_NAME = "Generic MIoT cover"
DATA_KEY = "cover." + DOMAIN

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
#     vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
#     vol.Required(CONF_HOST): cv.string,
#     vol.Required(CONF_TOKEN): vol.All(cv.string, vol.Length(min=32, max=32)),
#     vol.Required(CONF_MAPPING):vol.All(),
#     vol.Required(CONF_CONTROL_PARAMS):vol.All(),
#     vol.Optional(CONF_CLOUD): vol.All(),
# }
    SCHEMA
)

SCAN_INTERVAL = timedelta(seconds=2)
# pylint: disable=unused-argument

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
    """Set up the sensor from config."""

    if DATA_KEY not in hass.data:
        hass.data[DATA_KEY] = {}
Ejemplo n.º 17
0
    CONF_OPEN_CMD,
    CONF_CLOSE_CMD,
    CONF_STOP_CMD,
)
from .common import LocalTuyaEntity, TuyaDevice, prepare_setup_entities

_LOGGER = logging.getLogger(__name__)

DEFAULT_OPEN_CMD = "on"
DEFAULT_CLOSE_CMD = "off"
DEFAULT_STOP_CMD = "stop"

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(BASE_PLATFORM_SCHEMA).extend({
    vol.Optional(CONF_OPEN_CMD, default=DEFAULT_OPEN_CMD):
    cv.string,
    vol.Optional(CONF_CLOSE_CMD, default=DEFAULT_CLOSE_CMD):
    cv.string,
    vol.Optional(CONF_STOP_CMD, default=DEFAULT_STOP_CMD):
    cv.string,
})


def flow_schema(dps):
    """Return schema used in config flow."""
    return {
        vol.Optional(CONF_OPEN_CMD, default=DEFAULT_OPEN_CMD): str,
        vol.Optional(CONF_CLOSE_CMD, default=DEFAULT_CLOSE_CMD): str,
        vol.Optional(CONF_STOP_CMD, default=DEFAULT_STOP_CMD): str,
    }


async def async_setup_entry(hass, config_entry, async_add_entities):
Ejemplo n.º 18
0
PLATFORM_SCHEMA = COVER_PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICE_DEFAULTS, default=DEVICE_DEFAULTS_SCHEMA({})):
    DEVICE_DEFAULTS_SCHEMA,
    vol.Optional(CONF_DEVICES, default={}):
    vol.Schema({
        cv.string: {
            vol.Optional(CONF_NAME):
            cv.string,
            vol.Optional(CONF_TYPE, default=TYPE_STANDARD):
            vol.Any(TYPE_STANDARD, TYPE_INVERTED),
            vol.Optional(CONF_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_GROUP_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_NOGROUP_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_FIRE_EVENT, default=False):
            cv.boolean,
            vol.Optional(CONF_SIGNAL_REPETITIONS):
            vol.Coerce(int),
            vol.Optional(CONF_GROUP, default=True):
            cv.boolean,
            vol.Optional(CONF_MY_POSITION):
            vol.All(vol.Coerce(int), vol.Range(min=0, max=100)),
            vol.Optional(CONF_TRAVELLING_TIME_DOWN,
                         default=DEFAULT_TRAVEL_TIME):
            cv.positive_int,
            vol.Optional(CONF_TRAVELLING_TIME_UP, default=DEFAULT_TRAVEL_TIME):
            cv.positive_int,
        }
    }),
})
Ejemplo n.º 19
0
# Validation of the user's configuration
COVER_SCHEMA = vol.Schema({
    vol.Optional(CONF_DEVICE):
    cv.string,
    vol.Optional(CONF_USERNAME):
    cv.string,
    vol.Optional(CONF_PASSWORD):
    cv.string,
    vol.Optional(CONF_ACCESS_TOKEN):
    cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME):
    cv.string
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS):
    vol.Schema({cv.slug: COVER_SCHEMA}),
})

_LOGGER = logging.getLogger(__name__)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Demo covers."""
    covers = []
    devices = config.get(CONF_COVERS, {})

    _LOGGER.debug(devices)

    for device_id, device_config in devices.items():
        args = {
            "name": device_config.get(CONF_NAME),
Ejemplo n.º 20
0
DEFAULT_TIMEOUT = 10
DEFAULT_RETRY = 3

COVER_SCHEMA = vol.Schema({
    vol.Optional(CONF_COMMAND_OPEN, default=None): cv.string,
    vol.Optional(CONF_COMMAND_CLOSE, default=None): cv.string,
    vol.Optional(CONF_COMMAND_STOP, default=None): cv.string,
    vol.Optional(CONF_TRIGGER_TIME, default=DEFAULT_TIMEOUT): cv.positive_int,
    vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
    vol.Optional(CONF_FRIENDLY_NAME, default=DEFAULT_NAME): cv.string
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_IP_ADDRESS): cv.string,
    vol.Required(CONF_MAC): cv.string,
    vol.Required(CONF_COVERS): vol.Schema({cv.slug: COVER_SCHEMA}),
    vol.Optional(CONF_FRIENDLY_NAME, default=DEFAULT_NAME): cv.string
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    #pylint: disable=unused-argument
    """Set up the broadlink covers."""
    covers = []
    devices = config.get(CONF_COVERS)
    ip_addr = config.get(CONF_IP_ADDRESS)
    mac_addr = config.get(CONF_MAC)

    for object_id, device_config in devices.items():

        mac_addr = binascii.unhexlify(
Ejemplo n.º 21
0
import requests

from homeassistant.components.cover import (
    CoverDevice, PLATFORM_SCHEMA, ATTR_POSITION, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_SET_POSITION, SUPPORT_STOP)
from homeassistant.const import (
    CONF_NAME, CONF_HOST, STATE_CLOSED, STATE_OPEN, STATE_OPENING, STATE_UNKNOWN, ATTR_BATTERY_LEVEL)
import homeassistant.helpers.config_validation as cv

from base64 import b64decode

_LOGGER = logging.getLogger(__name__)

DEFAULT_NAME = 'PowerView'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_HOST): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})

############

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the PowerView covers."""
    ip_address = config[CONF_HOST]

    pv = PowerView(ip_address)
    cover_ids = pv.get_shades()

    covers = []
    for cover_id in cover_ids:
        covers.append(HdPowerView(hass, pv, cover_id))
    async_add_entities(covers, True)
Ejemplo n.º 22
0
CONF_TRAVELLING_TIME_UP = 'travelling_time_up'
CONF_INVERT_POSITION = 'invert_position'
CONF_INVERT_ANGLE = 'invert_angle'

DEFAULT_TRAVEL_TIME = 25
DEFAULT_NAME = 'KNX Cover'
DEPENDENCIES = ['knx']

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
    vol.Optional(CONF_MOVE_LONG_ADDRESS): cv.string,
    vol.Optional(CONF_MOVE_SHORT_ADDRESS): cv.string,
    vol.Optional(CONF_POSITION_ADDRESS): cv.string,
    vol.Optional(CONF_POSITION_STATE_ADDRESS): cv.string,
    vol.Optional(CONF_ANGLE_ADDRESS): cv.string,
    vol.Optional(CONF_ANGLE_STATE_ADDRESS): cv.string,
    vol.Optional(CONF_TRAVELLING_TIME_DOWN, default=DEFAULT_TRAVEL_TIME):
        cv.positive_int,
    vol.Optional(CONF_TRAVELLING_TIME_UP, default=DEFAULT_TRAVEL_TIME):
        cv.positive_int,
    vol.Optional(CONF_INVERT_POSITION, default=False): cv.boolean,
    vol.Optional(CONF_INVERT_ANGLE, default=False): cv.boolean,
})


async def async_setup_platform(hass, config, async_add_entities,
                               discovery_info=None):
    """Set up cover(s) for KNX platform."""
    if discovery_info is not None:
        async_add_entities_discovery(hass, discovery_info, async_add_entities)
    else:
Ejemplo n.º 23
0
CONF_DEVICE_ID = 'device_id'
CONF_LOCAL_KEY = 'local_key'
CONF_PROTOCOL_VERSION = 'protocol_version'

DEFAULT_ID = '1'
DEFAULT_PROTOCOL_VERSION = 3.3

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_ICON):
    cv.icon,
    vol.Required(CONF_HOST):
    cv.string,
    vol.Required(CONF_DEVICE_ID):
    cv.string,
    vol.Required(CONF_LOCAL_KEY):
    cv.string,
    vol.Required(CONF_NAME):
    cv.string,
    vol.Required(CONF_FRIENDLY_NAME):
    cv.string,
    vol.Required(CONF_PROTOCOL_VERSION, default=DEFAULT_PROTOCOL_VERSION):
    vol.Coerce(float),
    vol.Optional(CONF_ID, default=DEFAULT_ID):
    cv.string,
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up Tuya cover devices."""
    from . import pytuya

    covers = []
Ejemplo n.º 24
0
CONF_TRAVELLING_TIME_UP = 'travelling_time_up'
DEFAULT_TRAVEL_TIME = 25

CONF_OPEN_SWITCH_ENTITY_ID = 'open_switch_entity_id'
CONF_CLOSE_SWITCH_ENTITY_ID = 'close_switch_entity_id'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICES, default={}):
    vol.Schema({
        cv.string: {
            vol.Optional(CONF_NAME):
            cv.string,
            vol.Optional(CONF_OPEN_SWITCH_ENTITY_ID):
            cv.string,
            vol.Optional(CONF_CLOSE_SWITCH_ENTITY_ID):
            cv.string,
            vol.Optional(CONF_ALIASES, default=[]):
            vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_TRAVELLING_TIME_DOWN,
                         default=DEFAULT_TRAVEL_TIME):
            cv.positive_int,
            vol.Optional(CONF_TRAVELLING_TIME_UP, default=DEFAULT_TRAVEL_TIME):
            cv.positive_int,
        }
    }),
})


def devices_from_config(domain_config):
    """Parse configuration and add cover devices."""
    devices = []
    for device_id, config in domain_config[CONF_DEVICES].items():
Ejemplo n.º 25
0
import homeassistant.helpers.config_validation as cv

from homeassistant.components.cover import (
    CoverDevice, PLATFORM_SCHEMA, SUPPORT_OPEN, SUPPORT_CLOSE)
from homeassistant.const import (
    CONF_USERNAME, CONF_PASSWORD, STATE_UNKNOWN, STATE_CLOSED)

REQUIREMENTS = ['py_ryobi_gdo==0.0.10']

_LOGGER = logging.getLogger(__name__)

CONF_DEVICE_ID = 'device_id'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_DEVICE_ID): vol.All(cv.ensure_list, [cv.string]),
    vol.Required(CONF_PASSWORD): cv.string,
    vol.Required(CONF_USERNAME): cv.string,
})

SUPPORTED_FEATURES = (SUPPORT_OPEN | SUPPORT_CLOSE)


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Ryobi covers."""
    from py_ryobi_gdo import RyobiGDO as ryobi_door
    covers = []

    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    devices = config.get(CONF_DEVICE_ID)
Ejemplo n.º 26
0
from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA,
                                            SUPPORT_OPEN, SUPPORT_CLOSE)
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, STATE_UNKNOWN,
                                 STATE_CLOSED)

REQUIREMENTS = ['py_ryobi_gdo==0.0.10']

_LOGGER = logging.getLogger(__name__)

CONF_DEVICE_ID = 'device_id'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_DEVICE_ID):
    vol.All(cv.ensure_list, [cv.string]),
    vol.Required(CONF_PASSWORD):
    cv.string,
    vol.Required(CONF_USERNAME):
    cv.string,
})

SUPPORTED_FEATURES = (SUPPORT_OPEN | SUPPORT_CLOSE)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Ryobi covers."""
    from py_ryobi_gdo import RyobiGDO as ryobi_door
    covers = []

    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    devices = config.get(CONF_DEVICE_ID)
Ejemplo n.º 27
0
_COVERS_SCHEMA = vol.All(
    cv.ensure_list,
    [
        vol.Schema({
            CONF_NAME: cv.string,
            CONF_RELAY_PIN: cv.positive_int,
            CONF_STATE_PIN: cv.positive_int,
        })
    ]
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS): _COVERS_SCHEMA,
    vol.Optional(CONF_STATE_PULL_MODE, default=DEFAULT_STATE_PULL_MODE):
        cv.string,
    vol.Optional(CONF_RELAY_TIME, default=DEFAULT_RELAY_TIME): cv.positive_int,
    vol.Optional(CONF_INVERT_STATE, default=DEFAULT_INVERT_STATE): cv.boolean,
    vol.Optional(CONF_INVERT_RELAY, default=DEFAULT_INVERT_RELAY): cv.boolean,
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the RPi cover platform."""
    relay_time = config.get(CONF_RELAY_TIME)
    state_pull_mode = config.get(CONF_STATE_PULL_MODE)
    invert_state = config.get(CONF_INVERT_STATE)
    invert_relay = config.get(CONF_INVERT_RELAY)
    covers = []
    covers_conf = config.get(CONF_COVERS)

    for cover in covers_conf:
Ejemplo n.º 28
0
from homeassistant.components import rfxtrx
from homeassistant.components.cover import CoverDevice, PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
from homeassistant.components.rfxtrx import (
    CONF_AUTOMATIC_ADD, CONF_FIRE_EVENT, DEFAULT_SIGNAL_REPETITIONS,
    CONF_SIGNAL_REPETITIONS, CONF_DEVICES)
from homeassistant.helpers import config_validation as cv

DEPENDENCIES = ['rfxtrx']

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICES, default={}): {
        cv.string: vol.Schema({
            vol.Required(CONF_NAME): cv.string,
            vol.Optional(CONF_FIRE_EVENT, default=False): cv.boolean
        })
    },
    vol.Optional(CONF_AUTOMATIC_ADD, default=False):  cv.boolean,
    vol.Optional(CONF_SIGNAL_REPETITIONS, default=DEFAULT_SIGNAL_REPETITIONS):
        vol.Coerce(int),
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the RFXtrx cover."""
    import RFXtrx as rfxtrxmod

    covers = rfxtrx.get_devices_from_config(config, RfxtrxCover)
    add_devices(covers)

    def cover_update(event):
Ejemplo n.º 29
0
_COVERS_SCHEMA = vol.All(
    cv.ensure_list,
    [
        vol.Schema({
            CONF_NAME: cv.string,
            CONF_RELAY_PIN: cv.positive_int,
            CONF_STATE_PIN: cv.positive_int,
        })
    ]
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS): _COVERS_SCHEMA,
    vol.Optional(CONF_STATE_PULL_MODE, default=DEFAULT_STATE_PULL_MODE):
        cv.string,
    vol.Optional(CONF_RELAY_TIME, default=DEFAULT_RELAY_TIME): cv.positive_int,
    vol.Optional(CONF_INVERT_STATE, default=DEFAULT_INVERT_STATE): cv.boolean,
    vol.Optional(CONF_INVERT_RELAY, default=DEFAULT_INVERT_RELAY): cv.boolean,
})


# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the RPi cover platform."""
    relay_time = config.get(CONF_RELAY_TIME)
    state_pull_mode = config.get(CONF_STATE_PULL_MODE)
    invert_state = config.get(CONF_INVERT_STATE)
    invert_relay = config.get(CONF_INVERT_RELAY)
    covers = []
    covers_conf = config.get(CONF_COVERS)
Ejemplo n.º 30
0
# Import the device class from the component that you want to support
from homeassistant.components.cover import (
  CoverDevice, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION,
    ATTR_TILT_POSITION, PLATFORM_SCHEMA)
# from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_utc_time_change

# Home Assistant depends on 3rd party packages for API specific code.
REQUIREMENTS = ['pyserial==3.1.1']

_LOGGER = logging.getLogger(__name__)

# Validation of the rfplayer's configuration
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required('port'): cv.string,
})

OPEN_COMMAND='ON'
CLOSE_COMMAND='OFF'

def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Rfplayer X2D Covers platform."""
    import serial

    # Assign configuration variables. The configuration check takes care they are
    # present.
    # port = config.get('port')
    port = '/dev/ttyUSB0'
    # devices = config.get('entities')
    devices = [
Ejemplo n.º 31
0
from . import GroupEntity
from .util import attribute_equal, reduce_attribute

KEY_OPEN_CLOSE = "open_close"
KEY_STOP = "stop"
KEY_POSITION = "position"

DEFAULT_NAME = "Cover Group"

# No limit on parallel updates to enable a group calling another group
PARALLEL_UPDATES = 0

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {
        vol.Required(CONF_ENTITIES): cv.entities_domain(DOMAIN),
        vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
        vol.Optional(CONF_UNIQUE_ID): cv.string,
    }
)


async def async_setup_platform(
    hass: HomeAssistant,
    config: ConfigType,
    async_add_entities: AddEntitiesCallback,
    discovery_info: DiscoveryInfoType | None = None,
) -> None:
    """Set up the Group Cover platform."""
    async_add_entities(
        [
            CoverGroup(
Ejemplo n.º 32
0
import homeassistant.helpers.config_validation as cv

# This is the repo with the Tahoma unofficial python bindings
REQUIREMENTS = [
    'https://github.com/manuelciosici/TahomaProtocol'
    '/archive/7c2fca7cf6a8ea6eb4ad9507601c192099859cc9.zip'
    '#tahoma==1.0.0'
]  # the release number is actually fake

_LOGGER = logging.getLogger(__name__)

# Validation of the user's configuration
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_USERNAME):
    cv.string,
    vol.Required(CONF_PASSWORD):
    cv.string,
    vol.Optional(CONF_FILENAME, default='.tahoma.cookie'):
    cv.string,
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Somfy Tahoma cover platform."""

    import tahoma.protocol

    # setup connection with the Tahoma box
    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    cookie = config.get(CONF_FILENAME)
Ejemplo n.º 33
0
STATE_STOPPED = 'stopped'

STATES_MAP = {
    0: STATE_CLOSED,
    1: STATE_OPEN,
}

COVER_SCHEMA = vol.Schema({
    vol.Required(CONF_DEVICE_KEY): cv.string,
    vol.Required(CONF_HOST): cv.string,
    vol.Optional(CONF_NAME): cv.string,
    vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_COVERS): cv.schema_with_slug_keys(COVER_SCHEMA),
})


def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the OpenGarage covers."""
    covers = []
    devices = config.get(CONF_COVERS)

    for device_id, device_config in devices.items():
        args = {
            CONF_NAME: device_config.get(CONF_NAME),
            CONF_HOST: device_config.get(CONF_HOST),
            CONF_PORT: device_config.get(CONF_PORT),
            CONF_DEVICE_ID: device_config.get(CONF_DEVICE, device_id),
            CONF_DEVICE_KEY: device_config.get(CONF_DEVICE_KEY)
Ejemplo n.º 34
0
                    0x55, 0xFE, 0xFE, 0x3, 0x1, 0xB9, 0x24, 0x14]
CMD_COVER_CLOSE = [0x80, 0x00, 0x14, 0x42, 0xb, 0x44, 0x14, 0x42, 0x63, \
                    0x55, 0xFE, 0xFE, 0x3, 0x2, 0xF9, 0x25, 0x14]
CMD_COVER_STOP = [0x80, 0x00, 0x14, 0x42, 0xb, 0x44, 0x14, 0x42, 0x63, \
                    0x55, 0xFE, 0xFE, 0x3, 0x3, 0x38, 0xE5, 0x14]
CMD_COVER_POS =  [0x80, 0x00, 0x14, 0x42, 0xc, 0x44, 0x14, 0x42, 0x63, \
                    0x55, 0xfe, 0xfe, 0x3, 0x4, 0x1E, 0x66, 0xEA, 0x31]   
CMD_COVER_R_POS = [0x80, 0x00, 0x14, 0x42, 0xc, 0x44, 0x14, 0x42, 0x63, \
                    0x55, 0xfe, 0xfe, 0x1, 0x2, 0x01, 0x85, 0x42, 0x31]

SUPPORT_FEATURES = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_SET_POSITION | SUPPORT_STOP

_LOGGER = logging.getLogger(__name__)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional('name'): cv.string,
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Polyhome CoverDevice platform."""

    curtains = []
    if discovery_info is not None:
        # Not using hostname, as it seems to vary.
        device = {'name': discovery_info['name'], 'mac': discovery_info['mac']}
        curtains.append(DooYaCover(hass, device, None))
    else:
        for mac, device_config in config['devices'].items():
            device = {'name': device_config['name'], 'mac': mac}
            curtains.append(DooYaCover(hass, device, device_config, 50))
Ejemplo n.º 35
0
CONF_INVERT_ANGLE = "invert_angle"

DEFAULT_TRAVEL_TIME = 25
DEFAULT_NAME = "KNX Cover"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_NAME, default=DEFAULT_NAME):
    cv.string,
    vol.Optional(CONF_MOVE_LONG_ADDRESS):
    cv.string,
    vol.Optional(CONF_MOVE_SHORT_ADDRESS):
    cv.string,
    vol.Optional(CONF_POSITION_ADDRESS):
    cv.string,
    vol.Optional(CONF_POSITION_STATE_ADDRESS):
    cv.string,
    vol.Optional(CONF_ANGLE_ADDRESS):
    cv.string,
    vol.Optional(CONF_ANGLE_STATE_ADDRESS):
    cv.string,
    vol.Optional(CONF_TRAVELLING_TIME_DOWN, default=DEFAULT_TRAVEL_TIME):
    cv.positive_int,
    vol.Optional(CONF_TRAVELLING_TIME_UP, default=DEFAULT_TRAVEL_TIME):
    cv.positive_int,
    vol.Optional(CONF_INVERT_POSITION, default=False):
    cv.boolean,
    vol.Optional(CONF_INVERT_ANGLE, default=False):
    cv.boolean,
})


async def async_setup_platform(hass,
                               config,
Ejemplo n.º 36
0
    ATTR_STATE_VALUE,
    ATTR_MODEL,
    ATTR_FIRMWARE_VERSION,
    ATTR_HARDWARE_VERSION,
    SCHEMA,
    MAP,
    DUMMY_IP,
    DUMMY_TOKEN,
)
TYPE = 'cover'
_LOGGER = logging.getLogger(__name__)

DEFAULT_NAME = "Generic MIoT " + TYPE
DATA_KEY = TYPE + '.' + DOMAIN

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(SCHEMA)

SCAN_INTERVAL = timedelta(seconds=2)
# pylint: disable=unused-argument


@asyncio.coroutine
async def async_setup_platform(hass,
                               config,
                               async_add_devices,
                               discovery_info=None):
    """Set up the sensor from config."""

    if DATA_KEY not in hass.data:
        hass.data[DATA_KEY] = {}
Ejemplo n.º 37
0
    STATE_OPEN, STATE_OPENING)
from homeassistant.helpers import aiohttp_client, config_validation as cv

REQUIREMENTS = ['pymyq==1.1.0']
_LOGGER = logging.getLogger(__name__)

MYQ_TO_HASS = {
    'closed': STATE_CLOSED,
    'closing': STATE_CLOSING,
    'open': STATE_OPEN,
    'opening': STATE_OPENING
}

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_TYPE): cv.string,
    vol.Required(CONF_USERNAME): cv.string,
    vol.Required(CONF_PASSWORD): cv.string
})


async def async_setup_platform(
        hass, config, async_add_entities, discovery_info=None):
    """Set up the platform."""
    from pymyq import login
    from pymyq.errors import MyQError, UnsupportedBrandError

    websession = aiohttp_client.async_get_clientsession(hass)

    username = config[CONF_USERNAME]
    password = config[CONF_PASSWORD]
    brand = config[CONF_TYPE]
Ejemplo n.º 38
0
CONF_AUTOMATIC_ADD = 'automatic_add'
CONF_FIRE_EVENT = 'fire_event'
CONF_IGNORE_DEVICES = 'ignore_devices'
CONF_RECONNECT_INTERVAL = 'reconnect_interval'
CONF_SIGNAL_REPETITIONS = 'signal_repetitions'
CONF_WAIT_FOR_ACK = 'wait_for_ack'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_DEVICE_DEFAULTS, default=DEVICE_DEFAULTS_SCHEMA({})):
    DEVICE_DEFAULTS_SCHEMA,
    vol.Optional(CONF_DEVICES, default={}): vol.Schema({
        cv.string: {
            vol.Optional(CONF_NAME): cv.string,
            vol.Optional(CONF_ALIASES, default=[]):
                vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_GROUP_ALIASES, default=[]):
                vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_NOGROUP_ALIASES, default=[]):
                vol.All(cv.ensure_list, [cv.string]),
            vol.Optional(CONF_FIRE_EVENT, default=False): cv.boolean,
            vol.Optional(CONF_SIGNAL_REPETITIONS): vol.Coerce(int),
            vol.Optional(CONF_GROUP, default=True): cv.boolean,
        },
    }),
})


def devices_from_config(domain_config, hass=None):
    """Parse configuration and add Rflink cover devices."""
    devices = []
    for device_id, config in domain_config[CONF_DEVICES].items():
        device_config = dict(domain_config[CONF_DEVICE_DEFAULTS], **config)
Ejemplo n.º 39
0
_LOGGER = logging.getLogger(__name__)

DEFAULT_OPEN_CMD = "open"
DEFAULT_CLOSE_CMD = "close"
DEFAULT_STOP_CMD = "stop"
DEFAULT_SET_POSITION = 0
DEFAULT_GET_POSITION = 0
DEFAULT_LAST_MOVEMENT = 0

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(BASE_PLATFORM_SCHEMA).extend({
    vol.Optional(CONF_OPEN_CMD, default=DEFAULT_OPEN_CMD):
    cv.string,
    vol.Optional(CONF_CLOSE_CMD, default=DEFAULT_CLOSE_CMD):
    cv.string,
    vol.Optional(CONF_STOP_CMD, default=DEFAULT_STOP_CMD):
    cv.string,
    vol.Optional(CONF_SET_POSITION, default=DEFAULT_SET_POSITION):
    cv.positive_int,
    vol.Optional(CONF_GET_POSITION, default=DEFAULT_GET_POSITION):
    cv.positive_int,
    vol.Optional(CONF_LAST_MOVEMENT, default=DEFAULT_LAST_MOVEMENT):
    cv.positive_int,
})


def flow_schema(dps):
    """Return schema used in config flow."""
    return {
        vol.Optional(CONF_OPEN_CMD, default=DEFAULT_OPEN_CMD):
        str,
        vol.Optional(CONF_CLOSE_CMD, default=DEFAULT_CLOSE_CMD):
        str,
Ejemplo n.º 40
0
"""
import logging

import voluptuous as vol

import homeassistant.components.scsgate as scsgate
from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_DEVICES, CONF_NAME)
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

DEPENDENCIES = ['scsgate']

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_DEVICES): vol.Schema({cv.slug: scsgate.SCSGATE_SCHEMA}),
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the SCSGate cover."""
    devices = config.get(CONF_DEVICES)
    covers = []
    logger = logging.getLogger(__name__)

    if devices:
        for _, entity_info in devices.items():
            if entity_info[scsgate.CONF_SCS_ID] in scsgate.SCSGATE.devices:
                continue

            name = entity_info[CONF_NAME]