diff --git a/buttond.py b/buttond.py index 57d0023..7afa2ee 100755 --- a/buttond.py +++ b/buttond.py @@ -54,8 +54,8 @@ for b in config.get('button', 'names').split(','): 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) + _buttons[b].when_pressed = lambda path=closed: activate(path) + _buttons[b].when_released = lambda path=opened: activate(path) except (KeyError, GPIODeviceError) as e: print('Error configuring button', b, e) continue