简体   繁体   中英

How does Google Smart Home determine channelNumber for action.devices.commands.selectChannel?

  1. Created Google Smart Home Action.
  2. Implemented device with: a. deviceType = action.devices.types.SETTOP b. deviceTrait = action.devices.traits.Channel
  3. Device is successfully discovered and added to Google Home App's Homegraph.
  4. User sends command: "Ok Google, change to ESPN"
  5. Receives the following json in fulfillment URL:
     { "requestId": "[RequestId GUID]", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "[SettopBox device Id]" }], "execution": [{ "command": "action.devices.commands.selectChannel", "params": { "channelCode": "espn", "channelName": "ESPN", "channelNumber": "206" } }] }] } }] }

Questions:

  1. How does Google Smart Home determine the "channelNumber" value for "ESPN"? The user's command was "Ok Google, change to "ESPN". This does not contain any information about the channel number.
  2. If a provider was set automatically, is there a setting in Google Home or Google Assistant to change this provider?

The number of a channel for the Channel trait is provided in the SYNC request along with any relevant labels.

{
  "availableChannels": [
    {
      "key": "ktvu2",
      "names": [
        "Fox",
        "KTVU"
      ],
      "number": "2"
    },
    {
      "key": "abc1",
      "names": [
        "ABC",
        "ABC East"
      ],
      "number": "4-11"
    }
  ]
}

As shown in the snippet, the channel number comes from the service. This may be up to the developer of the integration how these numbers may be determined, whether from a cable provider or over-the-air. The field is optional, so a service without channel numbers may still work by saying its name.

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