code: def __set_data(self, data):
          
          ent = self.__entity_ref()
          self.set_state_data(ent, data)
docs: Sets the given state data on the given entity of the given class.
  
          :param data: State data to set.
          :type data: Dictionary mapping attributes to attribute values.
          :param entity: Entity to receive the state data.