8000 Fixes bug from refactor (#2050) · crowdus/python-docs-samples@0acc792 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0acc792

Browse files
authored
Fixes bug from refactor (GoogleCloudPlatform#2050)
1 parent de9fd87 commit 0acc792

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

iot/api-client/codelabs/ledlight.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def make_message(device_id, action, data=''):
4444
return '{{ "device" : "{}", "action":"{}" }}'.format(device_id, action)
4545

4646

47-
def run_action(action, data=''):
47+
def run_action(device_id, action, data=''):
4848
message = make_message(device_id, action, data)
4949
if not message:
5050
return
@@ -61,10 +61,10 @@ def main():
6161

6262
print('Bringing up device {}'.format(device_id))
6363
try:
64-
run_action('detach')
65-
run_action('attach')
66-
run_action('event', 'LED is online')
67-
run_action('subscribe')
64+
run_action(device_id, 'detach')
65+
run_action(device_id, 'attach')
66+
run_action(device_id, 'event', 'LED is online')
67+
run_action(device_id, 'subscribe')
6868

6969
while True:
7070
response = client_sock.recv(BUFF_SIZE)

0 commit comments

Comments
 (0)
0