(
    module: AbstractModule,
    firmware_file: str,
    loop: Optional[asyncio.AbstractEventLoop],
)
Apply update of given firmware file to given module.

    raises an UpdateError with the reason for the failure.
Apply update of given firmware file to given module.
Apply update of given firmware file to given module .
async def update_firmware(
    module: AbstractModule,
    firmware_file: str,
    loop: Optional[asyncio.AbstractEventLoop],
):
    """Apply update of given firmware file to given module.

    raises an UpdateError with the reason for the failure.
    """
    flash_port = await module.prep_for_update()
    kwargs: Dict[str, Any] = {
        "stdout": asyncio.subprocess.PIPE,
        "stderr": asyncio.subprocess.PIPE,
        "loop": loop,
    }
    successful, res = await module.bootloader()(flash_port, firmware_file, kwargs)
    if not successful:
        log.info(f"Bootloader reponse: {res}")
        raise UpdateError(res)
async def update_firmware ( module : AbstractModule , firmware_file : str , loop : Optional [ asyncio . AbstractEventLoop ] , ) : flash_port = await module . prep_for_update ( ) kwargs : Dict [ str , Any ] = { "stdout" : asyncio . subprocess . PIPE , "stderr" : asyncio . subprocess . PIPE , "loop" : loop , } successful , res = await module . bootloader ( ) ( flash_port , firmware_file , kwargs ) if not successful : log . info ( f"Bootloader reponse: {res}" ) raise UpdateError ( res )