async def METHOD_NAME(config):
    var = cg.new_Pvariable(config[CONF_ID])
    await cg.register_component(var, config)
    await cover.register_cover(var, config)
    # STOP
    await automation.build_automation(
        var.get_stop_trigger(), [], config[CONF_STOP_ACTION]
    )
    # OPEN
    await automation.build_automation(
        var.get_open_trigger(), [], config[CONF_OPEN_ACTION]
    )
    cg.add(var.set_open_duration(config[CONF_OPEN_DURATION]))
    if CONF_OPEN_ENDSTOP in config:
        bin = await cg.get_variable(config[CONF_OPEN_ENDSTOP])
        cg.add(var.set_open_endstop(bin))
    if CONF_OPEN_SENSOR in config:
        bin = await cg.get_variable(config[CONF_OPEN_SENSOR])
        cg.add(var.set_open_sensor(bin))
    if CONF_OPEN_OBSTACLE_SENSOR in config:
        bin = await cg.get_variable(config[CONF_OPEN_OBSTACLE_SENSOR])
        cg.add(var.set_open_obstacle_sensor(bin))
    # CLOSE
    await automation.build_automation(
        var.get_close_trigger(), [], config[CONF_CLOSE_ACTION]
    )
    cg.add(var.set_close_duration(config[CONF_CLOSE_DURATION]))
    if CONF_CLOSE_ENDSTOP in config:
        bin = await cg.get_variable(config[CONF_CLOSE_ENDSTOP])
        cg.add(var.set_close_endstop(bin))
    if CONF_CLOSE_SENSOR in config:
        bin = await cg.get_variable(config[CONF_CLOSE_SENSOR])
        cg.add(var.set_close_sensor(bin))
    if CONF_CLOSE_OBSTACLE_SENSOR in config:
        bin = await cg.get_variable(config[CONF_CLOSE_OBSTACLE_SENSOR])
        cg.add(var.set_close_obstacle_sensor(bin))
    # OTHER
    if CONF_MAX_DURATION in config:
        cg.add(var.set_max_duration(config[CONF_MAX_DURATION]))
    cg.add(var.set_has_built_in_endstop(config[CONF_HAS_BUILT_IN_ENDSTOP]))
    if CONF_ASSUMED_STATE in config:
        cg.add(var.set_assumed_state(config[CONF_ASSUMED_STATE]))
    else:
        cg.add(
            var.set_assumed_state(
                not (
                    (CONF_CLOSE_ENDSTOP in config and CONF_OPEN_ENDSTOP in config)
                    or config[CONF_INFER_ENDSTOP_FROM_MOVEMENT]
                )
            )
        )
    cg.add(var.set_update_interval(config[CONF_UPDATE_INTERVAL]))
    cg.add(var.set_infer_endstop(config[CONF_INFER_ENDSTOP_FROM_MOVEMENT]))
    if CONF_DIRECTION_CHANGE_WAIT_TIME in config:
        cg.add(
            var.set_direction_change_waittime(config[CONF_DIRECTION_CHANGE_WAIT_TIME])
        )
    cg.add(var.set_acceleration_wait_time(config[CONF_ACCELERATION_WAIT_TIME]))
    cg.add(var.set_obstacle_rollback(config[CONF_OBSTACLE_ROLLBACK]))