Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Fix list devices in IoT sample [(#2319)](GoogleCloudPlatform/python-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
gguuss authored Aug 12, 2019
1 parent 495b446 commit 6bee98a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions samples/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 6bee98a

Please sign in to comment.