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:
|
try:
|
||||||
# move to config section
|
# move to config section
|
||||||
c = config[b]
|
c = config[b]
|
||||||
# read macro values
|
# read from settings
|
||||||
|
pin = c.get('pin', None)
|
||||||
closed = c.get('close', None)
|
closed = c.get('close', None)
|
||||||
opened = c.get('open', None)
|
opened = c.get('open', None)
|
||||||
# set up button on pin
|
# set up button on pin
|
||||||
p = c.get('pin', None)
|
print('init button on GPIO', pin)
|
||||||
print('init button on GPIO', p)
|
_buttons[b] = Button(pin)
|
||||||
_buttons[b] = Button(p)
|
|
||||||
# connect button callbacks to anonymous functions
|
# connect button callbacks to anonymous functions
|
||||||
_buttons[b].when_pressed = lambda path=closed: _activate(path)
|
_buttons[b].when_pressed = lambda path=closed: _activate(path)
|
||||||
_buttons[b].when_released = lambda path=opened: _activate(path)
|
_buttons[b].when_released = lambda path=opened: _activate(path)
|
||||||
|
|
Loading…
Reference in New Issue