'Setup I2C-HAT instance for digital inputs scanner.'

def setup(self, i2c_hat):

    if hasattr(i2c_hat, self._DIGITAL_INPUTS):
        digital_inputs = getattr(i2c_hat, self._DIGITAL_INPUTS)
        old_value = None
        setattr(digital_inputs, self._OLD_VALUE, old_value)
        setattr(digital_inputs, self._CALLBACKS, {})
