cover.py
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the becker platform."""
    covers = []
    device = config.get(CONF_DEVICE)
    filename = config.get(CONF_FILENAME)
    _LOGGER.debug("%s: %s; %s: %s", CONF_DEVICE, device, CONF_FILENAME, filename)
    PyBecker.setup(hass, device=device, filename=filename)

    for device, device_config in config[CONF_COVERS].items():
        friendly_name = device_config.get(CONF_FRIENDLY_NAME, device)
        channel = device_config.get(CONF_CHANNEL)
        state_template = device_config.get(CONF_VALUE_TEMPLATE)
        remote_id = device_config.get(CONF_REMOTE_ID)
        travel_time_down = device_config.get(CONF_TRAVELLING_TIME_DOWN)
        travel_time_up = device_config.get(CONF_TRAVELLING_TIME_UP)
        intermediate_pos_up = device_config.get(CONF_INTERMEDIATE_POSITION_UP)
        intermediate_pos_down = device_config.get(CONF_INTERMEDIATE_POSITION_DOWN)
        intermediate_disable = device_config.get(CONF_INTERMEDIATE_DISABLE)
        if channel is None:
            _LOGGER.error("Must specify %s", CONF_CHANNEL)
            continue
        # Initialize all missing units in the db file and send stop command for sync
        await PyBecker.becker.init_unconfigured_unit(channel, name=friendly_name)

        covers.append(
            BeckerEntity(
                PyBecker.becker, friendly_name, channel,
                state_template, remote_id, travel_time_down, travel_time_up,
                intermediate_pos_up, intermediate_pos_down, intermediate_disable,
            )
        )

    async_add_entities(covers)
Set up the becker platform.
Set up the becker platform.
Set up the becker platform .
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    covers = []
    device = config.get(CONF_DEVICE)
    filename = config.get(CONF_FILENAME)
    _LOGGER.debug("%s: %s; %s: %s", CONF_DEVICE, device, CONF_FILENAME, filename)
    PyBecker.setup(hass, device=device, filename=filename)
    for device, device_config in config[CONF_COVERS].items():
        friendly_name = device_config.get(CONF_FRIENDLY_NAME, device)
        channel = device_config.get(CONF_CHANNEL)
        state_template = device_config.get(CONF_VALUE_TEMPLATE)
        remote_id = device_config.get(CONF_REMOTE_ID)
        travel_time_down = device_config.get(CONF_TRAVELLING_TIME_DOWN)
        travel_time_up = device_config.get(CONF_TRAVELLING_TIME_UP)
        intermediate_pos_up = device_config.get(CONF_INTERMEDIATE_POSITION_UP)
        intermediate_pos_down = device_config.get(CONF_INTERMEDIATE_POSITION_DOWN)
        intermediate_disable = device_config.get(CONF_INTERMEDIATE_DISABLE)
        if channel is None:
            _LOGGER.error("Must specify %s", CONF_CHANNEL)
            continue
        await PyBecker.becker.init_unconfigured_unit(channel, name=friendly_name)
        covers.append(
            BeckerEntity(
                PyBecker.becker, friendly_name, channel,
                state_template, remote_id, travel_time_down, travel_time_up,
                intermediate_pos_up, intermediate_pos_down, intermediate_disable,
            )
        )
    async_add_entities(covers)
async def async_setup_platform ( hass , config , async_add_entities , discovery_info = None ) : covers = [ ] device = config . get ( CONF_DEVICE ) filename = config . get ( CONF_FILENAME ) _LOGGER . debug ( "%s: %s; %s: %s" , CONF_DEVICE , device , CONF_FILENAME , filename ) PyBecker . setup ( hass , device = device , filename = filename ) for device , device_config in config [ CONF_COVERS ] . items ( ) : friendly_name = device_config . get ( CONF_FRIENDLY_NAME , device ) channel = device_config . get ( CONF_CHANNEL ) state_template = device_config . get ( CONF_VALUE_TEMPLATE ) remote_id = device_config . get ( CONF_REMOTE_ID ) travel_time_down = device_config . get ( CONF_TRAVELLING_TIME_DOWN ) travel_time_up = device_config . get ( CONF_TRAVELLING_TIME_UP ) intermediate_pos_up = device_config . get ( CONF_INTERMEDIATE_POSITION_UP ) intermediate_pos_down = device_config . get ( CONF_INTERMEDIATE_POSITION_DOWN ) intermediate_disable = device_config . get ( CONF_INTERMEDIATE_DISABLE ) if channel is None : _LOGGER . error ( "Must specify %s" , CONF_CHANNEL ) continue await PyBecker . becker . init_unconfigured_unit ( channel , name = friendly_name ) covers . append ( BeckerEntity ( PyBecker . becker , friendly_name , channel , state_template , remote_id , travel_time_down , travel_time_up , intermediate_pos_up , intermediate_pos_down , intermediate_disable , ) ) async_add_entities ( covers )
Set up the becker platform.
Set up the becker platform .
"""Set up the becker platform.""" # Initialize all missing units in the db file and send stop command for sync
hass
config
async_add_entities
discovery_info