1
0
Fork 0

uniform variable naming

This commit is contained in:
Kevin Matz 2019-11-17 10:54:43 -05:00
parent 6245c7ecd9
commit a6ea286726
1 changed files with 4 additions and 4 deletions

View File

@ -46,13 +46,13 @@ for b in config.get('button', 'names').split(','):
try:
# move to config section
c = config[b]
# read macro values
# read from settings
pin = c.get('pin', None)
closed = c.get('close', None)
opened = c.get('open', None)
# set up button on pin
p = c.get('pin', None)
print('init button on GPIO', p)
_buttons[b] = Button(p)
print('init button on GPIO', pin)
_buttons[b] = Button(pin)
# connect button callbacks to anonymous functions
_buttons[b].when_pressed = lambda path=closed: _activate(path)
_buttons[b].when_released = lambda path=opened: _activate(path)