def METHOD_NAME(self, command: Command) -> Optional[str]:  # noqa: C901
    """
    Handle a command.
    TODO: AL 20210218 create dispatch map and remove 'noqa(C901)'
    """
    logger.info(f"Got command {command}")
    if command.gcode == GCODE.OPEN_LID:
        self.lid_status = ThermocyclerLidStatus.OPEN
    elif command.gcode == GCODE.CLOSE_LID:
        self.lid_status = ThermocyclerLidStatus.CLOSED
    elif command.gcode == GCODE.GET_LID_STATUS:
        return f"Lid:{self.lid_status}"
    elif command.gcode == GCODE.SET_LID_TEMP:
        temperature = command.params["S"]
        assert isinstance(
            temperature, float
        ), f"invalid temperature '{temperature}'"
        self._lid_temperature.set_target(temperature)
    elif command.gcode == GCODE.GET_LID_TEMP:
        res = (
            f"T:{util.OptionalValue(self._lid_temperature.target)} "
            f"C:{self._lid_temperature.current} "
            f"H:none Total_H:none"
        )
        self._lid_temperature.tick()
        return res
    elif command.gcode == GCODE.EDIT_PID_PARAMS:
        pass
    elif command.gcode == GCODE.SET_PLATE_TEMP:
        for prefix, value in command.params.items():
            assert isinstance(value, float), f"invalid value '{value}'"
            if prefix == "S":
                self._plate_temperature.set_target(value)
            elif prefix == "V":
                self.plate_volume.val = value
            elif prefix == "H":
                self._plate_temperature.set_hold(value)
    elif command.gcode == GCODE.GET_PLATE_TEMP:
        plate_target = util.OptionalValue(self._plate_temperature.target)
        plate_current = self._plate_temperature.current
        plate_time_remaining = util.OptionalValue(
            self._plate_temperature.time_remaining
        )
        plate_total_hold_time = util.OptionalValue(
            self._plate_temperature.total_hold
        )
        res = (
            f"T:{plate_target} "
            f"C:{plate_current} "
            f"H:{plate_time_remaining} "
            f"Total_H:{plate_total_hold_time} "
        )
        self._plate_temperature.tick()
        return res
    elif command.gcode == GCODE.SET_RAMP_RATE:
        self.plate_ramp_rate.val = command.params["S"]
    elif command.gcode == GCODE.DEACTIVATE_ALL:
        self._plate_temperature.deactivate(temperature=util.TEMPERATURE_ROOM)
        self._lid_temperature.deactivate(temperature=util.TEMPERATURE_ROOM)
    elif command.gcode == GCODE.DEACTIVATE_LID:
        self._lid_temperature.deactivate(temperature=util.TEMPERATURE_ROOM)
    elif command.gcode == GCODE.DEACTIVATE_BLOCK:
        self._plate_temperature.deactivate(temperature=util.TEMPERATURE_ROOM)
    elif command.gcode == GCODE.DEVICE_INFO:
        return (
            f"serial:{self._settings.serial_number} "
            f"model:{self._settings.model} "
            f"version:{self._settings.version}"
        )
    return None