code: def alert(self, msg):
          
          if self.event_callback is not None:
              try:
                  self.event_callback(msg)
              except Exception as exception:  # pylint: disable=broad-except
                  _LOGGER.exception(exception)
  
          if self.persistence:
              self.persistence.need_save = True
docs: Tell anyone who wants to know that a sensor was updated.