Skip to content

Commit

Permalink
Fix list devices in IoT sample (#2319)
Browse files Browse the repository at this point in the history
  • Loading branch information
gguuss authored Aug 12, 2019
1 parent 4e44c60 commit 8ade7dd
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions iot/api-client/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,17 +704,8 @@ def list_devices_for_gateway(
device.get('numId'),
device.get('id')))

if devices.get('deviceNumIds') is not None:
for device_id in devices.get('deviceNumIds'):
device_name = '{}/devices/{}'.format(
registry_name, device_id)
device = client.projects().locations().registries().devices().get(
name=device_name).execute()
print('Id: {}\n\tName: {}\n\traw: {}'.format(
device_id, device.get('id'), device))
else:
if not found:
print('No devices bound to gateway {}'.format(gateway_id))
if not found:
print('No devices bound to gateway {}'.format(gateway_id))
# [END iot_list_devices_for_gateway]


Expand Down

0 comments on commit 8ade7dd

Please sign in to comment.