Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix template light: individual color modes #2990

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 45 additions & 21 deletions src/language-service/src/schemas/integrations/core/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,12 +854,6 @@ interface LightPlatformItem {
*/
availability_template?: Template;

/**
* Defines a template to get the color of the light. Must render a tuple (hue, saturation).
* https://www.home-assistant.io/integrations/light.template#color_template
*/
color_template?: Template;

/**
* Defines a template to get the list of supported effects. Must render a list.
* https://www.home-assistant.io/integrations/light.template#effect_list_template
Expand All @@ -884,6 +878,12 @@ interface LightPlatformItem {
*/
friendly_name?: string;

/**
* Defines a template to get the HS color of the light. Must render a tuple (hue, saturation).
* https://www.home-assistant.io/integrations/light.template#hs_template
*/
hs_template?: Template;

/**
* Defines a template for an icon or picture, e.g., showing a different icon for different states.
* https://www.home-assistant.io/integrations/light.template#icon_template
Expand All @@ -909,34 +909,64 @@ interface LightPlatformItem {
min_mireds_template?: Template;

/**
* Defines an action to run when the light is given a color command.
* https://www.home-assistant.io/integrations/light.template#set_color
* Defines a template to get the RGB color of the light. Must render a tuple or a list (red, green, blue).
* https://www.home-assistant.io/integrations/light.template#rgb_template
*/
set_color?: Action | Action[];
rgb_template?: Template;

/**
* Defines a template to get the RGBW color of the light. Must render a tuple or a list (red, green, blue, white).
* https://www.home-assistant.io/integrations/light.template#rgbw_template
*/
rgbw_template?: Template;

/**
* Defines a template to get the RGBWW color of the light. Must render a tuple or a list (red, green, blue, cold white, warm white).
* https://www.home-assistant.io/integrations/light.template#rgbww_template
*/
rgbww_template?: Template;

/**
* Defines an action to run when the light is given a effect command.
* https://www.home-assistant.io/integrations/light.template#set_effect
*/
set_effect?: Action | Action[];

/**
* Defines an action to run when the light is given a hs color command. Available variables: `hs` as a tuple, `h` and `s`.
* https://www.home-assistant.io/integrations/light.template#set_hs
*/
set_hs?: Action | Action[];

/**
* Defines an action to run when the light is given a brightness command.
* https://www.home-assistant.io/integrations/light.template#set_level
*/
set_level?: Action | Action[];

/**
* Defines an action to run when the light is given a color temperature command.
* https://www.home-assistant.io/integrations/light.template#set_temperature
* Defines an action to run when the light is given an RGB color command. Available variables: `rgb` as a tuple, `r`, `g` and `b`.
* https://www.home-assistant.io/integrations/light.template#set_rgb
*/
set_temperature?: Action | Action[];
set_rgb?: Action | Action[];

/**
* Defines an action to run when the light is given an RGBW color command. Available variables: `rgbw` as a tuple, `rgb` as a tuple, `r`, `g`, `b` and `w`.
* https://www.home-assistant.io/integrations/light.template#set_rgbw
*/
set_rgbw?: Action | Action[];

/**
* Defines an action to run when the light is given a white value command.
* https://www.home-assistant.io/integrations/light.template#set_white_value
* Defines an action to run when the light is given an RGBWW color command. Available variables: `rgbww` as a tuple, `rgb` as a tuple, `r`, `g`, `b`, `cw` and `ww`.
* https://www.home-assistant.io/integrations/light.template#set_rgbww
*/
set_white_value?: Action | Action[];
set_rgbww?: Action | Action[];

/**
* Defines an action to run when the light is given a color temperature command.
* https://www.home-assistant.io/integrations/light.template#set_temperature
*/
set_temperature?: Action | Action[];

/**
* Defines a template to get if light supports transition.
Expand Down Expand Up @@ -973,12 +1003,6 @@ interface LightPlatformItem {
* https://www.home-assistant.io/integrations/light.template#value_template
*/
value_template?: Template;

/**
* Defines a template to get the white value of the light.
* https://www.home-assistant.io/integrations/light.template#white_value_template
*/
white_value_template?: Template;
}

interface SensorPlatformItem {
Expand Down