uniform variable naming
This commit is contained in:
parent
6245c7ecd9
commit
a6ea286726
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue