def METHOD_NAME(self, new_state: enums.EventStatus):
    """
    Set the state of the task. (For internal use only)
    :param new_state: The new state of the task.
    """
    if not isinstance(new_state, enums.EventStatus):  # type: ignore
        raise TypeError('"new_state" needs to be of type enums.EventStatus!')
    if self.event_id not in self.remote.events:
        raise ValueError('"event_id" not existing!')
    self.remote.events[self.event_id].state = new_state
    # clear the list of who has read it
    self.remote.events[self.event_id].read_by_who = []
    if new_state == enums.EventStatus.COMPLETE:
        self.logger.info("### TASK COMPLETE ###")
    elif new_state == enums.EventStatus.FAILED:
        self.logger.error("### TASK FAILED ###")