简体   繁体   English

Google Smart Home上的操作

[英]Actions on Google Smart Home

i wrote a smart home skill for Alexa, which interacts with a bunch of REST apis i created. 我为Alexa写了一个智能家居技巧,该技巧与我创建的大量REST API交互。 It integrated with my OAUTH2 server, all good. 它与我的OAUTH2服务器集成在一起,一切都很好。

I've tried reading the limited Actions on Google documentation, and looked at the example Node app on github, and i'm stumped. 我尝试阅读Google文档中有限的Actions,并查看了github上的示例Node应用程序,但我很困惑。 The action.json seems to take a single URL - i'm unclear on what that should be, the example takes the easy route of passing a single url, then deciding on sync/execute etc as url param in the index.js, which I don't want to do. action.json似乎使用单个URL-我不清楚应该是什么,该示例采用了简单的方法来传递单个URL,然后在index.js中将sync / execute等确定为url参数,这我不想做 Can someone please explain how this works for them? 有人可以解释一下这是如何工作的吗? I see a bunch of other people struggling on here, so i take some comfort that i may be thick, but i'm not alone! 我看到很多其他人在这里苦苦挣扎,所以我感到安慰,因为我可能很胖,但我并不孤单!

Since you developed an Alexa smart home skill, you should know the skill adapter hosted as a Lambda function. 由于您开发了Alexa智能家居技能,因此您应该了解作为Lambda函数托管的技能适配器。 The example Node.js program works just like the skill adapter. 示例Node.js程序的工作原理与技能适配器相同。

When Google Home invokes your smart home app, it sends the request to the url in the action.json. 当Google Home调用您的智能家居应用时,它将请求发送到action.json中的url。 You can use the example Node.js app for this url, then write your function to handle sync/execute requests. 您可以将示例Node.js应用程序用于此URL,然后编写函数来处理同步/执行请求。 This part should be very similar to the REST APIs you created for Alexa. 这部分应该与您为Alexa创建的REST API非常相似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM