mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-14 21:06:28 +00:00
Document light color_mode when rendering effects (#2054)
This commit is contained in:
parent
ca28ff9a34
commit
181f468fb4
@ -11,9 +11,9 @@ A light entity controls the brightness, hue and saturation color value, white va
|
|||||||
| Name | Type | Default | Description
|
| Name | Type | Default | Description
|
||||||
| ---- | ---- | ---- | ----
|
| ---- | ---- | ---- | ----
|
||||||
| brightness | <code>int | None</code> | `None` | The brightness of this light between 1..255
|
| brightness | <code>int | None</code> | `None` | The brightness of this light between 1..255
|
||||||
| color_mode | <code>ColorMode | None</code> | `None` | The color mode of the light. The returned color mode must be present in the `supported_color_modes` property.
|
| color_mode | <code>ColorMode | None</code> | `None` | The color mode of the light. The returned color mode must be present in the `supported_color_modes` property unless the light is rendering an effect.
|
||||||
| color_temp_kelvin | <code>int | None</code> | `None` | The CT color value in K. This property will be copied to the light's state attribute when the light's color mode is set to `ColorMode.COLOR_TEMP` and ignored otherwise.
|
| color_temp_kelvin | <code>int | None</code> | `None` | The CT color value in K. This property will be copied to the light's state attribute when the light's color mode is set to `ColorMode.COLOR_TEMP` and ignored otherwise.
|
||||||
| effect | <code>str | None</code> | `None` | The current effect.
|
| effect | <code>str | None</code> | `None` | The current effect. Should be `EFFECT_OFF` if the light supports effects and no effect is currently rendered.
|
||||||
| effect_list | <code>list[str] | None</code> | `None` | The list of supported effects.
|
| effect_list | <code>list[str] | None</code> | `None` | The list of supported effects.
|
||||||
| hs_color | <code>tuple[float, float] | None</code> | `None` | The hue and saturation color value (float, float). This property will be copied to the light's state attribute when the light's color mode is set to `ColorMode.HS` and ignored otherwise.
|
| hs_color | <code>tuple[float, float] | None</code> | `None` | The hue and saturation color value (float, float). This property will be copied to the light's state attribute when the light's color mode is set to `ColorMode.HS` and ignored otherwise.
|
||||||
| is_on | <code>bool | None</code> | `None` | If the light entity is on or not.
|
| is_on | <code>bool | None</code> | `None` | If the light entity is on or not.
|
||||||
@ -68,6 +68,17 @@ If the light is in mode `ColorMode.HS`, `ColorMode.RGB` or `ColorMode.XY`, the l
|
|||||||
|
|
||||||
If the light is in mode `ColorMode.RGBW` or `ColorMode.RGBWW`, the light's state attribute will contain the light's color expressed in `hs`, `rgb` and `xy` color format. The color conversion is an approximation done by adding the white channels to the color.
|
If the light is in mode `ColorMode.RGBW` or `ColorMode.RGBWW`, the light's state attribute will contain the light's color expressed in `hs`, `rgb` and `xy` color format. The color conversion is an approximation done by adding the white channels to the color.
|
||||||
|
|
||||||
|
### Color Mode when rendering effects
|
||||||
|
|
||||||
|
When rendering an effect, the `color_mode` should be set according to the adjustments supported by the
|
||||||
|
effect. If the effect does not support any adjustments, the `color_mode` should be set to `ColorMode.ONOFF`.
|
||||||
|
If the effect allows adjusting the brightness, the `color_mode` should be set to `ColorMode.BRIGHTNESS`.
|
||||||
|
|
||||||
|
When rendering an effect, it's allowed to set the `color_mode` to a more restrictive mode than the color modes
|
||||||
|
indicated by the `supported_color_mode` property:
|
||||||
|
- A light which supports colors is allowed to set color_mode to `ColorMode.ONOFF` or `ColorMode.BRIGHTNESS` when controlled by an effect
|
||||||
|
- A light which supports brightness is allowed to set color_mode to `ColorMode.ONOFF` when controlled by an effect
|
||||||
|
|
||||||
## Supported Features
|
## Supported Features
|
||||||
|
|
||||||
Supported features are defined by using values in the `LightEntityFeature` enum
|
Supported features are defined by using values in the `LightEntityFeature` enum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user