stevenleeg / geemusic

A bridge between Google Music and Amazon's Alexa
GNU General Public License v3.0
662 stars 181 forks source link

PlaybackController - physical button request api #204

Open cargoudel opened 6 years ago

cargoudel commented 6 years ago

Some devices like the Amazon Tap have physical next and back buttons. Mine don't seem to work at all. While some buttons like Play/Pause are handed locally on the Tap, others like Next/Skip generate a PlaybackController.NextCommandIssued request (as I understand the documentation).

https://developer.amazon.com/docs/custom-skills/playback-controller-interface-reference.html

Is there a good way to implement these? I tried adding a line like @ask.intent('PlaybackController.NextCommandIssued') and the same code as the existing next function. in playback.py But I have a feeling I am way off and didn't seem to work. Is there any easy way to see unhandled requests when running on the cloud with heroku.com?

What is the right way to implement this? Should they already work? I don't think PlaybackController.NextCommandIssued is automatically mapped to AMAZON.NextIntent.

fergyfresh commented 6 years ago

It should be in the debug logs of the server as a 4XX/5XX request. I'm looking into it right now and it doesn't seem too hard. It seems like it would be a matter of figuring out if there is a decorator we can leverage or perhaps we'd have to make one if the decorator isn't baked into the base Flask-Ask.

fergyfresh commented 6 years ago

In the docs that you linked it says its not a DIRECTIVE. The NextIntent however, is most definitely a directive. You can physically see the difference between the two requests by looking at my adds-tests fork play_request request object and comparing it to the request object in the link you provided.

fergyfresh commented 6 years ago

I unfortunately don't have one of these devices so I couldn't test it personally, but I hope something I said spawns us into some more conversation so I can help you get this functionality in this repo!

fergyfresh commented 6 years ago

Probably going to require changes to the Flask-Ask code base I think. https://github.com/johnwheeler/flask-ask/pull/189/files it is very similar to this I think.