在Flask-Ask Alexa Echo Show中检测支持的接口

时间:2018-01-03 13:56:13

标签: python alexa alexa-skills-kit alexa-voice-service flask-ask

我正在尝试为Echo Show [Screen Enabled]和Echo Dot [仅限音频]构建语音技能。显然,响应指令必须根据设备进行更改,否则会导致" Alexa having trouble accessing the skill"。

我们如何确定Flask-ASK中支持的接口?

...
  "context": {
    "System": {
      "application": {
        "applicationId": "<value>"
      },
      "user": {
        "userId": "amzn1.ask.account.<value>"
      },
      "device": {
        "supportedInterfaces": {
          "Display": {},
          "AudioPlayer": {},
          "VideoApp": {}
        }
      }
    }
  },
...

1 个答案:

答案 0 :(得分:0)

像这样

def has_screen():
if context.System.device.supportedInterfaces.Display is None:
        return False
    else:
        return True