code: def update_target_state(self, value: str, force: bool = True) -> datetime:
          
          value = value.lower()
          if not force:
              current_state = self.current_state
              if current_state == 'unknown':
                  raise RuntimeError("Unable to set target state when current "
                                     "state is 'unknown'")
  
              allowed_target_states = self._allowed_target_states[current_state]
  
              LOG.debug('Updating target state of %s to %s', self._id, value)
  
              if value not in allowed_target_states:
                  raise ValueError("Invalid target state: '{}'. {} can be "
                                   "commanded to states: {}".
                                   format(value, current_state,
                                          allowed_target_states))
  
          return self._update_state('target', value)
docs: Set the target state.
  
          Args:
              value (str): New value for target state
              force (bool): If true, ignore allowed transitions
  
          Returns:
              datetime, update timestamp
  
          Raises:
              RuntimeError, if it is not possible to currently set the target
              state.
              ValueError, if the specified target stat is not allowed.