دليل مكبّرات الصوت الذكية للمنزل

action.devices.types.SPEAKER: هذا الجهاز مكبّر صوت متّصل لا يقسّم الصوت إلى قنوات منفصلة (على سبيل المثال، بين جهازَين لليسار واليمين).

ويشير هذا النوع إلى أن الجهاز يحصل على رمز المتحدث وبعض المرادفات والأسماء المستعارة ذات الصلة.

إمكانات الجهاز

يُرجى الرجوع إلى مستندات السمات المرتبطة للحصول على تفاصيل التنفيذ، مثل السمات والحالة التي يجب أن تدعمها خدمتك، وكيفية إنشاء ردود EXECUTE وQUERY.

السمات المطلوبة

هذه السمات والطلبات مطلوبة إذا كانت منطبقة على جهازك. إذا كان جهازك لا يوفّر هذه السمات، أدخِل رمز الخطأ functionNotSupported في إحدى استجابة QUERY أو EXECUTE. راجِع الأخطاء والاستثناءات للاطّلاع على مزيد من المعلومات.

ننصحك باستخدام هذه السمات على جهازك، إذا كانت منطبقة. ومع ذلك، يمكنك الاختيار من بين جميع السمات المتاحة لك ومطابقتها مع وظائف منتجاتك الحالية على أفضل نحو.

متطلبات الجودة

  • وقت الاستجابة: يجب أن يكون أقل من أو يساوي 3000 ملي ثانية.
  • الموثوقية: يجب أن تكون أكبر من أو تساوي 97%.

مثال على جهاز: مكبّر صوت بسيط

يحتوي هذا القسم على أمثلة لأحمال نيّة تمثّل "مكبّر صوت" شائع استنادًا إلى نوع الجهاز وسماته أعلاه. في حال إضافة سمات أو إزالتها في عملية التنفيذ، عدِّل ردودك وفقًا لذلك لتعكس هذه التغييرات.

نموذج استجابة المزامنة

طلب
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
الرد
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.SPEAKER",
        "traits": [
          "action.devices.traits.MediaState",
          "action.devices.traits.OnOff",
          "action.devices.traits.Volume",
          "action.devices.traits.TransportControl"
        ],
        "name": {
          "name": "Simple speaker"
        },
        "willReportState": true,
        "attributes": {
          "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"
        }
      }
    ]
  }
}

نموذج ردّ QUERY

طلب
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "currentVolume": 10,
        "isMuted": false,
        "activityState": "ACTIVE",
        "playbackState": "PAUSED"
      }
    }
  }
}

نماذج أوامر EXECUTE

غير مفعّل

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.OnOff.

طلب
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

كتم الصوت

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.Volume.

طلب
{
  "requestId": "6894439706274654534",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mute",
                "params": {
                  "mute": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654534",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 10,
          "isMuted": true
        }
      }
    ]
  }
}

ضبط مستوى الصوت

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.Volume.

طلب
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.setVolume",
                "params": {
                  "volumeLevel": 11
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 11,
          "isMuted": false
        }
      }
    ]
  }
}

إيقاف ملفات MediaClosedCaptioning

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOff"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

تفعيل ميزة MediaClosedCaptioningOn

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOn",
                "params": {
                  "closedCaptioningLanguage": "en"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

وسائط Next

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaNext"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "FAST_FORWARDING"
        }
      }
    ]
  }
}

إيقاف الوسائط مؤقتًا

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PAUSED"
        }
      }
    ]
  }
}

السابقة

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPrevious"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "REWINDING"
        }
      }
    ]
  }
}

استئناف الوسائط

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654528",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

إيقاف الوسائط

للحصول على تفاصيل إضافية عن معلَمات الأوامر، يُرجى الاطّلاع على مرجع action.devices.traits.TransportControl.

طلب
{
  "requestId": "6894439706274654530",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaStop"
              }
            ]
          }
        ]
      }
    }
  ]
}
الرد
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "STOPPED"
        }
      }
    ]
  }
}

أخطاء الجهاز

راجِع القائمة الكاملة للأخطاء والاستثناءات.