【发布时间】:2021-06-19 00:28:17
【问题描述】:
我正在尝试构建一个智能家居项目,我想使用语音命令来控制我家中的智能设备,我发现我必须使用 homegraph API 来实现它。那么有没有人可以帮助我,比如我想为此使用我自己的基于 django 的云网络,并且只有谷歌文档上提供了 firebase 示例。如果有人知道,请指导我'-'
【问题讨论】:
标签: google-cloud-platform google-home google-smart-home
我正在尝试构建一个智能家居项目,我想使用语音命令来控制我家中的智能设备,我发现我必须使用 homegraph API 来实现它。那么有没有人可以帮助我,比如我想为此使用我自己的基于 django 的云网络,并且只有谷歌文档上提供了 firebase 示例。如果有人知道,请指导我'-'
【问题讨论】:
标签: google-cloud-platform google-home google-smart-home
我假设是基于 Django 的框架。
虽然概念文档可能仅在 Node.js 中包含 sn-ps,但您可以查看 REST API pages 以获取使其工作所需的 JSON 请求/响应字段。
为了简化开发过程,Google 发布了service protos,可用于以编程方式定义 Home Graph 请求、响应和数据对象。您也可以使用google-api-python-client 包。这让您可以使用如下 API 构建 homegraph 服务:
from googleapiclient.discovery import build
service = build('homegraph', 'v1')
# Here you can call methods on the service object
# service...
那么你可以根据库文档create and execute requests。
您还需要setup authentication 才能执行请求。
【讨论】: