@adam-chalmers/google-home 中文文档教程
Google Home
一个简单的包,用于将消息发送到本地网络上的 Google Home,它包装了 google-assistant 库,以便于使用。
Installation
要使用这个包,你需要做一些额外的设置。 按照此处的安装说明开始。
Usage
要使用此包,只需导入包并使用所需的配置实例化类:
import { GoogleHome } from "@adam-chalmers/google-home";
const homeConfig = {
keyFilePath: "YOUR_API_KEY_FILE_PATH.json",
savedTokensPath: "YOUR_TOKENS_FILE_PATH.json"
};
const home = new GoogleHome(homeConfig);
Typescript
对于 TypeScript 用户,此包还导出 GoogleHomeConfig
接口以简化设置。
Google Home
A simple package for sending messages to a Google Home on the local network that wraps the google-assistant library for ease of use.
Installation
To use this package, you'll need to do some additional setup. Follow the installation instructions here to get started.
Usage
To use this package, simply import the package and instantiate the class with the required configuration:
import { GoogleHome } from "@adam-chalmers/google-home";
const homeConfig = {
keyFilePath: "YOUR_API_KEY_FILE_PATH.json",
savedTokensPath: "YOUR_TOKENS_FILE_PATH.json"
};
const home = new GoogleHome(homeConfig);
Typescript
For TypeScript users, this package also exports the GoogleHomeConfig
interface to make setup easier.