1
0
Fork 0

be verbose when setting up buttons

This commit is contained in:
Kevin Matz 2019-11-16 16:21:26 -05:00
parent fbf406e92d
commit 5799184fa6
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ for b in config.get('button', 'names').split(','):
closed = c.get('close', None)
opened = c.get('open', None)
# set up button on pin
_buttons[b] = Button(c.getint("pin", None))
p = c.get('pin', None)
print('init button on GPIO', p)
_buttons[b] = Button(p)
# connect button callbacks to anonymous functions
_buttons[b].when_pressed = lambda: activate(closed)
_buttons[b].when_released = lambda: activate(opened)