'Return a new callback function.'

def callback_factory(self):

    def node_update(msg):
        'Handle    node    updates    from    the    MySensors    gateway.'
        _LOGGER.debug('Update:    node    %s,    child    %s    sub_type    %s', msg.node_id, msg.child_id, msg.sub_type)
        for callback in self.platform_callbacks:
            callback(self, msg)
    return node_update
