Akıllı Ev Yayın Çubuğu Kılavuzu

action.devices.types.STREAMING_STICK - Bu cihaz, genellikle TV gibi bir ekrana bağlı USB veya HDMI kablosuyla çalışan, çubuk benzeri küçük bir form faktörüne sahiptir.

Bu tür, cihazın Streaming Stick simgesinin yanı sıra bazı eş anlamlı kelimeleri ve takma adları aldığını belirtir.

Cihaz özellikleri

Hizmetinizin desteklemesi gereken özellikler ve durumlar ile EXECUTE ve QUERY yanıtlarının nasıl oluşturulacağı gibi uygulama ayrıntıları için ilgili özellik belgelerine bakın.

Gerekli özellikler

Bu özellikler ve komutlar, cihazınız için geçerliyse gereklidir. Cihazınız bu özellikleri desteklemiyorsa bir QUERY veya EXECUTE yanıtına functionNotSupported hata kodunu girin. Daha fazla bilgi için Hatalar ve istisnalar bölümüne bakın.

Cihazınız için geçerliyse bu özellikler önerilir. Bununla birlikte, mevcut ürün işlevselliğinize en iyi şekilde uyması için mevcut tüm özellikleri bir arada kullanabilirsiniz.

Kalite gereksinimleri

  • Gecikme: En fazla 3000 ms olmalıdır.
  • Güvenilirlik: En az %97 olmalıdır.

Örnek cihaz: Basit akış çubuğu

Bu bölümde, cihaz türüne ve yukarıdaki özelliklere göre ortak bir "Streaming Stick"i temsil eden örnek amaç yükleri yer alır. Uygulamanızda özellik ekler veya kaldırırsanız yanıtlarınızı bu değişiklikleri yansıtacak şekilde değiştirin.

Örnek Senkronizasyon yanıtı

İstek
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.STREAMING_STICK",
        "traits": [
          "action.devices.traits.AppSelector",
          "action.devices.traits.MediaState",
          "action.devices.traits.TransportControl",
          "action.devices.traits.Volume"
        ],
        "name": {
          "name": "Simple streaming stick"
        },
        "willReportState": true,
        "attributes": {
          "availableApplications": [
            {
              "key": "youtube",
              "names": [
                {
                  "name_synonym": [
                    "YouTube"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "transportControlSupportedCommands": [
            "NEXT",
            "PREVIOUS",
            "PAUSE",
            "STOP",
            "RESUME"
          ],
          "volumeMaxLevel": 11,
          "volumeCanMuteAndUnmute": true,
          "supportActivityState": true,
          "supportPlaybackState": true
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

Örnek QUERY yanıtı

İstek
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "currentApplication": "youtube",
        "currentVolume": 10,
        "isMuted": false,
        "activityState": "ACTIVE",
        "playbackState": "PAUSED"
      }
    }
  }
}

Örnek EXECUTE komutları

appInstall

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.AppSelector referansına bakın.

İstek
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appInstall",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

appSearch

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.AppSelector referansına bakın.

İstek
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSearch",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

appSelect

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.AppSelector referansına bakın.

İstek
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSelect",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

mediaClosedCaptioningOff

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOff"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaClosedCaptioningOn

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOn",
                "params": {
                  "closedCaptioningLanguage": "en"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaNext

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaNext"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "FAST_FORWARDING"
        }
      }
    ]
  }
}

mediaPause

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654528",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PAUSED"
        }
      }
    ]
  }
}

mediaPrevious

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654530",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPrevious"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "REWINDING"
        }
      }
    ]
  }
}

mediaResume

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaStop

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.TransportControl referansına bakın.

İstek
{
  "requestId": "6894439706274654534",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaStop"
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654534",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "STOPPED"
        }
      }
    ]
  }
}

sesi kapat

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Volume referansına bakın.

İstek
{
  "requestId": "6894439706274654538",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mute",
                "params": {
                  "mute": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654538",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 10,
          "isMuted": true
        }
      }
    ]
  }
}

setVolume

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Volume referansına bakın.

İstek
{
  "requestId": "6894439706274654536",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.setVolume",
                "params": {
                  "volumeLevel": 11
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654536",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 11,
          "isMuted": false
        }
      }
    ]
  }
}

Cihaz ERRORS

Hataların ve istisnaların tam listesini inceleyin.