<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_callback(self, name, func):
 """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 """


        if name not in self.callbacks:
            raise ValueError("Unknown callback name: %s" % name)

        self.callbacks[name].add(func)