code: def add_callback(self, name, func):
          
  
          if name not in self.callbacks:
              raise ValueError("Unknown callback name: %s" % name)
  
          self.callbacks[name].add(func)
docs: Add a callback when Device events happen
  
          Args:
              name (str): currently support 'on_scan' and 'on_disconnect'
              func (callable): the function that should be called