googlesamples / assistant-sdk-nodejs

Apache License 2.0
93 stars 27 forks source link

Using service account loses device trait actions #4

Closed jefhil closed 6 years ago

jefhil commented 6 years ago

I was getting ready to allow other people to test my implementation, Then, i realized that I was using my own account to grant permission to my device. So, I did it all over again, this time using a service account. I had to upgrade to google-auth-library 2.0 but i eventually got it all to work EXCEPT for device actions. It ignores the built in traits like dock and start/stop on/off and for 'color red' says it needs permission. any ideas? heres my action console screen: Linked device models . TPR Series Product name TPR Series Manufacturer name OhmniLabs Model Id ohmnilabstpr-tpr-series-9xw6v5 Device type Light Supported traits Brightness , ColorSpectrum , Dock , OnOff , StartStop

Fleker commented 6 years ago

You're using a service account to make requests? I'm not sure that'll work? Users will more likely need to generate their own credentials so that your application can make requests on their behalf.

jefhil commented 6 years ago

it works fine (update code attached -- requires oauth 2.0) . I plan on having users create credentials but wanted something workable until they did that. Also, curious about purpose of deviceInstanceID since user credentials seem to be for whole class of devices. Is there a more appropriate forum for me to post these questions? Thanx -- Jeff share.txt

jefhil commented 6 years ago

sorry to have bothered you. It seems this problem (not responding to device commands) has more to do with how I generate the credentials (and from what account) than the type of credentials. Thanks for your patience.

Fleker commented 6 years ago

Device instance ID is to identify that it's my bedroom speaker as opposed to my living room speaker, even they're both mine. They would probably have the same device model ID.

There's the Google+ community for more discussion-based questions, but I also monitor GitHub for questions.