•  


AoG ProTips: Test Suite for Smart Home | by Dave Smith | Google Developers | Medium
Illustration of a home with the Smart Home technology and other tech symbols.

AoG ProTips: Test Suite for Smart Home

Dave Smith
Google Developers
Published in
3 min read Apr 10, 2020

--

Missed our weekly video? Don’t worry, watch this week’s #AoGProTips ??

The test suite for smart home allows you to self-test your smart home Action and verify that it meets all the necessary criteria before you submit for review. The test suite automatically generates test cases for the supported devices and traits reported by your Action. The test suite cannot verify traits which do not have state (such as Locator ) or cannot accept commands (such as RunCycle ).

In this post, we’ll explore some of the best practices to ensure that your test suite runs are successful!

Can you hear me now?

The test suite generates text to speech (TTS) audio commands for each device trait reported by your Action. The commands must be heard by a nearby Google Home or Nest device in order to reach your smart home Action. If the device hears the command incorrectly, it will not execute the correct command and the test will fail.

Note: This also means that you must ensure the Nest device you are testing with is linked to the same user account that you supplied to the test suite.

Test suite uses audio for commands

Ensure that you run the test suite in an environment where the Nest device can hear your computer speakers clearly without background noise. You might even consider putting headphones over the device microphones to block out any external sound!

Implement Report State

The test suite verifies command results by inspecting the state in Home Graph for the expected value. The test suite does not verify the EXECUTE response or send a QUERY intent to determine success, so you should test those portions of your smart home Action separately. If you do not update Home Graph directly after each command, the tests will fail.

Test suite requires data in Home Graph

To update Home Graph, you must implement the Report State API in your smart home Action to notify Google of asynchronous changes with your devices, and enable the willReportState flag for each device in your SYNC response ? the test suite will skip devices with this flag set to false.

{

"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"agentUserId": "1836.15267389",
"devices": [
{
"id": "123",
"willReportState": true
...
}
],
},
}

Report state frequently

It’s critical for your smart home Action to maintain accurate data in Home Graph at all times. When Google Assistant does not find recent state data in Home Graph, it must issue a QUERY intent to your service to determine the current state, adding latency to the user experience. You should also call Report State after any command sent to the device, even if the command does not trigger a state change (e.g. the light is already on).

Following these steps ensures Home Graph is accurate starting from the initial SYNC , and avoids common failure cases in the test suite due to missing or incorrect Home Graph data for the devices under test.

Submit your results

After completing your test run, it’s time to submit your results through the certification form in the Actions console . During submission, you will have the opportunity to note any device traits that require additional testing and add comments to your results to indicate if any failing tests are due to design considerations in your devices.

Certification request in Actions console

For more helpful tips on getting the most out of your actions, be sure to check out the rest of the AoG ProTips series ? and share your tips with us on Twitter using the hashtag #AoGProTips .

--

--

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본