简体   繁体   中英

How to start a timer with the Actions on Google Timer trait?

I'm currently trying to develop a device that will work with the Google assistant. I've followed the Google codelab to set up firebase with the dummy project. Now I'd like to implement the Timer trait. I'm currently able to set a timer by voice command on my virtual device using action.devices.commands.StartTimer but it only seems to set the desired timer duration in the database and doesn't not actually start it because when I ask "how many minutes are left on the timer" , it answers with the time initially set. Do I need to pass the information to the device itself, that will handle the countdown and update firebase in real-time so when I do a QUERY , I get the timerRemainingSec from the device through the database ?

Thanks !

Yes. The action.devices.commands.TimerStart command is one of the Smart Home commands that is available if you're building a device. Google itself doesn't do anything with this except pass the command to you.

You are responsible for implementing the command on your device however makes the most sense for your device.

Google just provides a way for users to access your device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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