集成页面结构

本页展示推荐的集成页面结构,以及一些可复用的常用文案。

本页给出了集成页面的高层结构建议。 请结合以下文档一起使用:

集成页面的基础结构

  • Introduction
    • Use case
  • Supported/unsupported devices
  • Prerequisites
  • Configuration
  • Configuration options
  • Supported functionality
  • Actions
  • Examples
  • Data updates
  • Known limitations
  • Troubleshooting
  • Community notes
  • Removing the integration

集成文档可复用内容

你可以复用那些在多个页面中反复出现的通用文本片段

下面这些片段在集成页面中尤其常用。

Configuration

显示预定义配置文本块的截图 显示预定义配置文本块的截图

要使用这个元素,请加入以下内容:

{% include integrations/config_flow.md %}

当前片段内容可参考 config_flow.md

configuration_basic 区块

如果你的集成通过 config flow 完成设置,请使用 configuration_basic 区块描述配置项。

显示通过 UI 设置的集成配置变量区块的截图 显示通过 UI 设置的集成配置变量区块的截图

{% configuration_basic %}
Host:
    description: "The IP address of your bridge. You can find it in your router or in the Integration app under **Bridge Settings** > **Local API**."
Local access token:
    description: "The local access token for your bridge. You can find it in the Integration app under **Bridge Settings** > **Local API**."
{% endconfiguration_basic %}

面向 YAML 集成的 configuration 区块

如果你的集成只能通过 YAML 配置,请使用 configuration 区块描述配置项。

显示 YAML 集成配置变量区块的截图 显示 YAML 集成配置变量区块的截图

{% configuration %}
Host:
    description: "The IP address of your bridge. You can find it in your router or in the Integration app under **Bridge Settings** > **Local API**."
    required: false
    type: string
Local access token:
    description: "The local access token for your bridge. You can find it in the Integration app under **Bridge Settings** > **Local API**."
    required: false
    type: string
{% endconfiguration %}