'Register I2C-HAT online callback.'

def register_online_callback(self, address, channel, callback):

    with self._lock:
        i2c_hat = self._i2c_hats[address]
        callbacks = getattr(i2c_hat, self._CALLBACKS)
        callbacks[channel] = callback
        setattr(i2c_hat, self._CALLBACKS, callbacks)
