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

Commit 6bee98a

Browse files
authored
Fix list devices in IoT sample [(#2319)](GoogleCloudPlatform/python-docs-samples#2319)
1 parent 495b446 commit 6bee98a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

samples/api-client/manager/manager.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -704,17 +704,8 @@ def list_devices_for_gateway(
704704
device.get('numId'),
705705
device.get('id')))
706706

707-
if devices.get('deviceNumIds') is not None:
708-
for device_id in devices.get('deviceNumIds'):
709-
device_name = '{}/devices/{}'.format(
710-
registry_name, device_id)
711-
device = client.projects().locations().registries().devices().get(
712-
name=device_name).execute()
713-
print('Id: {}\n\tName: {}\n\traw: {}'.format(
714-
device_id, device.get('id'), device))
715-
else:
716-
if not found:
717-
print('No devices bound to gateway {}'.format(gateway_id))
707+
if not found:
708+
print('No devices bound to gateway {}'.format(gateway_id))
718709
# [END iot_list_devices_for_gateway]
719710

720711

0 commit comments

Comments
 (0)