def METHOD_NAME(self, data: bytes, callback: Optional[ProgressCallback] = None) -> None:
    # based on https://github.com/NordicSemiconductor/pc-nrfutil/blob/1caa347b1cca3896f4695823f48abba15fbef76b/nordicsemi/dfu/dfu.py
    # we have to implement this ourselves because we want to read the files
    # from memory, not from the filesystem
    image = Image.parse(data)
    time.sleep(3)
    dfu = DfuTransportSerial(self.path)
    if callback:
        total = len(image.firmware_bin)
        callback(0, total)
        dfu.register_events_callback(
            DfuEvent.PROGRESS_EVENT,
            CallbackWrapper(callback, total),
        )
    dfu.open()
    dfu.send_init_packet(image.firmware_dat)
    dfu.send_firmware(image.firmware_bin)
    dfu.close()