code: def next(self):
          
          if self._history_index == -1:
              return None
  
          new_index = self._history_index + 1
          connected = (
              new_index == len(self.model.state.entity_history(
                  self.entity_type, self.entity_id)) - 1
          )
          return self.model.state.get_entity(
              self.entity_type, self.entity_id, self._history_index - 1,
              connected=connected)
docs: Return a copy of this object at its next state in
          history.
  
          Returns None if this object is already the latest.
  
          The returned object is "disconnected", i.e. does not receive
          live updates, unless it is current (latest).