Javad Moradi
Javad Moradi

Reputation: 994

How to get the device metadata info from google cloud iot core?

I am quite new to google cloud services and I'm trying to get the device metadata that I have added to devices under a registry, but it doesn't seem to work.

device.firebase_id

is unknown where the device is my device and firebase_id is the added attribute to metadata. and device.metadata.firebase_id throws this exception:

'google.protobuf.pyext._message.ScalarMapContainer' object has no attribute 'firebase_id'

Thanks in advance.

Upvotes: 1

Views: 192

Answers (1)

Gabe Weiss
Gabe Weiss

Reputation: 3332

device.metadata is a map, so I think you can retrieve the value with:

device.metadata['firebase_id']

Upvotes: 2

Related Questions