设备特征
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
设备类型的功能取决于您为每种设备类型添加的特征。每种设备类型都有许多建议的特征,但您可以根据需要添加任意特征。
名称 |
设备特征 |
说明 |
推荐的设备类型 |
Brightness |
action.devices.traits.Brightness |
绝对亮度设置为 0 到 100 之间的标准化范围(根据光源的配置,单个灯可能不支持范围内的每个点)。 |
Light Guide |
ColorSpectrum |
action.devices.traits.ColorSpectrum |
这适用于采用 RGB 颜色范围的“完整”颜色灯泡。灯可能包含 ColorSpectrum 和 ColorTemperature 的任意组合;强调光和 LED 灯条可能只有光谱,而某些阅读灯泡只有温度。基本灯泡或智能插座上的哑光灯也没有。 |
Light Guide |
ColorTemperature(色温) |
action.devices.traits.ColorTemperature |
这适用于以开尔文作为颜色点的“温暖”灯泡。这通常与 ColorSpectrum 是一个单独的模态,并且可能具有 Spectrum 无法到达的通过温度可用的白色点。Google 可能会根据可用的特征,根据请求和灯类型选择合适的模式(例如,把客厅的灯设为白色)。 |
Light Guide |
Dock |
action.devices.traits.Dock |
此特征专为可指示返回充电的移动设备而设计。 |
各种电器 |
OnOff |
action.devices.traits.OnOff |
适用于具有二进制文件开启或关闭的任何设备的基本开启和关闭功能,包括插头和开关以及许多未来的设备。 |
Light Guide |
StartStop |
action.devices.traits.StartStop |
启动和停止设备的功能与开启和关闭设备的功能类似。开启和启动时沿用此特征功能的设备会有所不同。与仅具有开启和关闭状态的设备不同,某些可以启动和停止的设备在执行操作时也可以暂停。 |
任何设备 - 主要是电器和吸尘器,以及具有特定活动行为的高级性能及其他 |
TemperatureSetting |
action.devices.traits.TemperatureSetting |
此特征涵盖处理温度点和模式。 |
温控器指南 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[null,null,["最后更新时间 (UTC):2023-12-02。"],[[["\u003cp\u003eDevice functionality is determined by assigned traits.\u003c/p\u003e\n"],["\u003cp\u003eEach device type has suggested traits, but you can customize them.\u003c/p\u003e\n"],["\u003cp\u003eTraits control actions like brightness, color, on/off state, and temperature.\u003c/p\u003e\n"],["\u003cp\u003eSome traits are recommended for specific device types, like lights or thermostats.\u003c/p\u003e\n"]]],["Device functionality is defined by added traits. Available traits include `Brightness` (0-100 range), `ColorSpectrum` (RGB), and `ColorTemperature` (Kelvin). `Dock` is for self-mobile devices returning for charging. `OnOff` provides basic on/off, while `StartStop` allows starting, stopping, and pausing. `TemperatureSetting` handles temperature points and modes. Each trait has recommended device types, but any combination can be used.\n"],null,["# Device Traits\n\nThe functionality for device types comes from the traits that you add to each one.\nEach device type has a number of recommended traits, but you can add whichever ones you\nwant.\n\n| Name | Device Traits | Description | Recommended Device Types |\n|--------------------------------------------------------------------------|--------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| [Brightness](/assistant/sdk/reference/traits/brightness) | `action.devices.traits.Brightness` | Absolute brightness setting is in a normalized range from 0 to 100 (individual lights may not support every point in the range based on their LED configuration). | [Light Guide](/assistant/smarthome/guides/light) |\n| [ColorSpectrum](/assistant/sdk/reference/traits/colorspectrum) | `action.devices.traits.ColorSpectrum` | This applies to \"full\" color bulbs that take RGB color ranges. Lights may have any combination of ColorSpectrum and [ColorTemperature](/assistant/sdk/reference/traits/colortemperature); accent lights and LED strips may just have Spectrum, whereas some reading bulbs just have Temperature. Basic bulbs, or dumb lights on smart plugs, have neither. | [Light Guide](/assistant/smarthome/guides/light) |\n| [ColorTemperature](/assistant/sdk/reference/traits/colortemperature) | `action.devices.traits.ColorTemperature` | This applies to \"warmth\" bulbs that take a color point in Kelvin. This is generally a separate modality from [ColorSpectrum](/assistant/sdk/reference/traits/colorspectrum), and there may be white points available via Temperature that cannot be reached by Spectrum. Based on available traits, Google may pick the appropriate mode to use based on request and light type (for example, *Make the living room lights white* might send Temperature commands to some bulbs and Spectrum commands to LED strips). | [Light Guide](/assistant/smarthome/guides/light) |\n| [Dock](/assistant/sdk/reference/traits/dock) | `action.devices.traits.Dock` | This trait is designed for self-mobile devices that can be commanded to return for charging. | Various appliances |\n| [OnOff](/assistant/sdk/reference/traits/onoff) | `action.devices.traits.OnOff` | The basic on and off functionality for any device that has binary on and off, including plugs and switches as well as many future devices. | [Light Guide](/assistant/smarthome/guides/light) |\n| [StartStop](/assistant/sdk/reference/traits/startstop) | `action.devices.traits.StartStop` | Starting and stopping a device serves a similar function to turning it on and off. Devices that inherit this trait function differently when turned on and when started. Unlike devices that simply have an on and off state, some devices that can start and stop are also able to pause while performing operation. | Any - mostly appliances and vacuums and other things that have specific activity behavior above and beyond power |\n| [TemperatureSetting](/assistant/sdk/reference/traits/temperaturesetting) | `action.devices.traits.TemperatureSetting` | This trait covers handling both temperature point and modes. | [Thermostat Guide](/assistant/smarthome/guides/thermostat) |"]]