allow modification of variable in child scope (#2688)
Fixes `NameError: name 'count' is not defined`
This commit is contained in:
parent
717c2ab99e
commit
34009e3096
1 changed files with 1 additions and 0 deletions
|
@ -46,6 +46,7 @@ def setup(hass, config):
|
|||
|
||||
# Listener to handle fired events
|
||||
def handle_event(event):
|
||||
nonlocal count
|
||||
count += 1
|
||||
print('Total events received:', count)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue