1
0
Fork 0

more verbose output when registering callbacks

This commit is contained in:
Kevin Matz 2019-11-17 10:55:07 -05:00
parent a6ea286726
commit 9f4a575a6d
1 changed files with 2 additions and 0 deletions

View File

@ -54,7 +54,9 @@ for b in config.get('button', 'names').split(','):
print('init button on GPIO', pin)
_buttons[b] = Button(pin)
# connect button callbacks to anonymous functions
print('connecting GPIO', pin, '"closed" to macro', closed)
_buttons[b].when_pressed = lambda path=closed: _activate(path)
print('connecting GPIO', pin, '"opened" to macro', opened)
_buttons[b].when_released = lambda path=opened: _activate(path)
except (KeyError, GPIODeviceError) as e: