- Go to the Actions console
- Create a new project. This project can be independent of your other projects.
- You can use this project to test any of your actions that are in a test state
- For this new project, enable the Google Assistant API
- Go to the Device Registration section.
- Click REGISTER MODEL
- Fill out the product and manufacturer name
- Set the Device type to Light, although the choice does not matter
- Download the
credentials.json
file - Use this credentials file to generate test credentials:
node generate-credentials.js /path/to/credentials.json
- Copy and paste the URL and enter the authorization code. You will see a response similar to the following:
Saved user credentials in "test-credentials.json"
- Register a new device instance using googlesamples-assistant-devicetool and update DEVICE_MODEL_ID and DEVICE_INSTANCE_ID constants in index.ts.
googlesamples-assistant-devicetool --project-id PROJECT_ID register-device --device 'my-device-identifier' \ --model 'my-model-identifier' \ --nickname 'My Assistant Light'
- Install dependencies and run sample
yarn
yarn start
- If the assistant says you need to allow personal results, open Google Home app on your smartphone and check notifications in the app. Once it's allowed, you'll be able to start testing!
- Modify index.ts and write your tests.