From c0cdc0fe795640904f4e704c95e48bf71a52eb7c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 18 Feb 2021 16:15:16 +0100 Subject: [PATCH] Add advanced selectors to Light service definitions (#46732) --- homeassistant/components/light/services.yaml | 483 ++++++++++++++++++- 1 file changed, 472 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/light/services.yaml b/homeassistant/components/light/services.yaml index 202899db7bf..f777cd3d348 100644 --- a/homeassistant/components/light/services.yaml +++ b/homeassistant/components/light/services.yaml @@ -1,12 +1,12 @@ # Describes the format for available light services turn_on: - description: Turn a light on. + description: Turn a light on target: fields: transition: name: Transition - description: Duration in seconds it takes to get to next state + description: Duration in seconds it takes to get to next state. example: 60 selector: number: @@ -16,27 +16,218 @@ turn_on: unit_of_measurement: seconds mode: slider rgb_color: + name: RGB-color description: Color for the light in RGB-format. + advanced: true example: "[255, 100, 100]" + selector: + object: color_name: + name: Color name description: A human readable color name. + advanced: true example: "red" + selector: + select: + options: + - "aliceblue" + - "antiquewhite" + - "aqua" + - "aquamarine" + - "azure" + - "beige" + - "bisque" + - "black" + - "blanchedalmond" + - "blue" + - "blueviolet" + - "brown" + - "burlywood" + - "cadetblue" + - "chartreuse" + - "chocolate" + - "coral" + - "cornflowerblue" + - "cornsilk" + - "crimson" + - "cyan" + - "darkblue" + - "darkcyan" + - "darkgoldenrod" + - "darkgray" + - "darkgreen" + - "darkgrey" + - "darkkhaki" + - "darkmagenta" + - "darkolivegreen" + - "darkorange" + - "darkorchid" + - "darkred" + - "darksalmon" + - "darkseagreen" + - "darkslateblue" + - "darkslategray" + - "darkslategrey" + - "darkturquoise" + - "darkviolet" + - "deeppink" + - "deepskyblue" + - "dimgray" + - "dimgrey" + - "dodgerblue" + - "firebrick" + - "floralwhite" + - "forestgreen" + - "fuchsia" + - "gainsboro" + - "ghostwhite" + - "gold" + - "goldenrod" + - "gray" + - "green" + - "greenyellow" + - "grey" + - "honeydew" + - "hotpink" + - "indianred" + - "indigo" + - "ivory" + - "khaki" + - "lavender" + - "lavenderblush" + - "lawngreen" + - "lemonchiffon" + - "lightblue" + - "lightcoral" + - "lightcyan" + - "lightgoldenrodyellow" + - "lightgray" + - "lightgreen" + - "lightgrey" + - "lightpink" + - "lightsalmon" + - "lightseagreen" + - "lightskyblue" + - "lightslategray" + - "lightslategrey" + - "lightsteelblue" + - "lightyellow" + - "lime" + - "limegreen" + - "linen" + - "magenta" + - "maroon" + - "mediumaquamarine" + - "mediumblue" + - "mediumorchid" + - "mediumpurple" + - "mediumseagreen" + - "mediumslateblue" + - "mediumspringgreen" + - "mediumturquoise" + - "mediumvioletred" + - "midnightblue" + - "mintcream" + - "mistyrose" + - "moccasin" + - "navajowhite" + - "navy" + - "navyblue" + - "oldlace" + - "olive" + - "olivedrab" + - "orange" + - "orangered" + - "orchid" + - "palegoldenrod" + - "palegreen" + - "paleturquoise" + - "palevioletred" + - "papayawhip" + - "peachpuff" + - "peru" + - "pink" + - "plum" + - "powderblue" + - "purple" + - "red" + - "rosybrown" + - "royalblue" + - "saddlebrown" + - "salmon" + - "sandybrown" + - "seagreen" + - "seashell" + - "sienna" + - "silver" + - "skyblue" + - "slateblue" + - "slategray" + - "slategrey" + - "snow" + - "springgreen" + - "steelblue" + - "tan" + - "teal" + - "thistle" + - "tomato" + - "turquoise" + - "violet" + - "wheat" + - "white" + - "whitesmoke" + - "yellow" + - "yellowgreen" hs_color: + name: Hue/Sat color description: Color for the light in hue/sat format. Hue is 0-360 and Sat is 0-100. + advanced: true example: "[300, 70]" + selector: + object: xy_color: + name: XY-color description: Color for the light in XY-format. + advanced: true example: "[0.52, 0.43]" + selector: + object: color_temp: + name: Color temperature (mireds) description: Color temperature for the light in mireds. + advanced: true example: 250 + selector: + number: + min: 153 + max: 500 + step: 1 + unit_of_measurement: mireds + mode: slider kelvin: + name: Color temperature (Kelvin) description: Color temperature for the light in Kelvin. + advanced: true example: 4000 + selector: + number: + min: 2000 + max: 6500 + step: 100 + unit_of_measurement: K + mode: slider white_value: + name: White level description: Number between 0..255 indicating level of white. + advanced: true example: "250" + selector: + number: + min: 0 + max: 255 + step: 1 + mode: slider brightness: name: Brightness value description: @@ -66,99 +257,369 @@ turn_on: unit_of_measurement: "%" mode: slider brightness_step: + name: Brightness step value description: Change brightness by an amount. Should be between -255..255. + advanced: true example: -25.5 + selector: + number: + min: -225 + max: 255 + step: 1 + mode: slider brightness_step_pct: + name: Brightness step description: Change brightness by a percentage. Should be between -100..100. example: -10 + selector: + number: + min: -100 + max: 100 + step: 1 + unit_of_measurement: "%" + mode: slider profile: + name: Profile description: Name of a light profile to use. + advanced: true example: relax + selector: + text: flash: + name: Flash description: If the light should flash. Valid values are short and long. + advanced: true example: short values: - short - long + selector: + select: + options: + - long + - short effect: + name: Effect description: Light effect. example: random values: - colorloop - random + selector: + text: turn_off: - description: Turn a light off. + description: Turn a light off + target: fields: - entity_id: - description: Name(s) of entities to turn off. - example: "light.kitchen" transition: + name: Transition description: Duration in seconds it takes to get to next state. example: 60 + selector: + number: + min: 0 + max: 300 + step: 1 + unit_of_measurement: seconds + mode: slider flash: + name: Flash description: If the light should flash. Valid values are short and long. + advanced: true example: short values: - short - long + selector: + select: + options: + - long + - short toggle: - description: Toggles a light. + description: Toggles a light + target: fields: - entity_id: - description: Name(s) of entities to turn on - example: "light.kitchen" transition: - description: Duration in seconds it takes to get to next state + name: Transition + description: Duration in seconds it takes to get to next state. example: 60 + selector: + number: + min: 0 + max: 300 + step: 1 + unit_of_measurement: seconds + mode: slider rgb_color: + name: RGB-color description: Color for the light in RGB-format. + advanced: true example: "[255, 100, 100]" + selector: + object: color_name: + name: Color name description: A human readable color name. + advanced: true example: "red" + selector: + select: + options: + - "aliceblue" + - "antiquewhite" + - "aqua" + - "aquamarine" + - "azure" + - "beige" + - "bisque" + - "black" + - "blanchedalmond" + - "blue" + - "blueviolet" + - "brown" + - "burlywood" + - "cadetblue" + - "chartreuse" + - "chocolate" + - "coral" + - "cornflowerblue" + - "cornsilk" + - "crimson" + - "cyan" + - "darkblue" + - "darkcyan" + - "darkgoldenrod" + - "darkgray" + - "darkgreen" + - "darkgrey" + - "darkkhaki" + - "darkmagenta" + - "darkolivegreen" + - "darkorange" + - "darkorchid" + - "darkred" + - "darksalmon" + - "darkseagreen" + - "darkslateblue" + - "darkslategray" + - "darkslategrey" + - "darkturquoise" + - "darkviolet" + - "deeppink" + - "deepskyblue" + - "dimgray" + - "dimgrey" + - "dodgerblue" + - "firebrick" + - "floralwhite" + - "forestgreen" + - "fuchsia" + - "gainsboro" + - "ghostwhite" + - "gold" + - "goldenrod" + - "gray" + - "green" + - "greenyellow" + - "grey" + - "honeydew" + - "hotpink" + - "indianred" + - "indigo" + - "ivory" + - "khaki" + - "lavender" + - "lavenderblush" + - "lawngreen" + - "lemonchiffon" + - "lightblue" + - "lightcoral" + - "lightcyan" + - "lightgoldenrodyellow" + - "lightgray" + - "lightgreen" + - "lightgrey" + - "lightpink" + - "lightsalmon" + - "lightseagreen" + - "lightskyblue" + - "lightslategray" + - "lightslategrey" + - "lightsteelblue" + - "lightyellow" + - "lime" + - "limegreen" + - "linen" + - "magenta" + - "maroon" + - "mediumaquamarine" + - "mediumblue" + - "mediumorchid" + - "mediumpurple" + - "mediumseagreen" + - "mediumslateblue" + - "mediumspringgreen" + - "mediumturquoise" + - "mediumvioletred" + - "midnightblue" + - "mintcream" + - "mistyrose" + - "moccasin" + - "navajowhite" + - "navy" + - "navyblue" + - "oldlace" + - "olive" + - "olivedrab" + - "orange" + - "orangered" + - "orchid" + - "palegoldenrod" + - "palegreen" + - "paleturquoise" + - "palevioletred" + - "papayawhip" + - "peachpuff" + - "peru" + - "pink" + - "plum" + - "powderblue" + - "purple" + - "red" + - "rosybrown" + - "royalblue" + - "saddlebrown" + - "salmon" + - "sandybrown" + - "seagreen" + - "seashell" + - "sienna" + - "silver" + - "skyblue" + - "slateblue" + - "slategray" + - "slategrey" + - "snow" + - "springgreen" + - "steelblue" + - "tan" + - "teal" + - "thistle" + - "tomato" + - "turquoise" + - "violet" + - "wheat" + - "white" + - "whitesmoke" + - "yellow" + - "yellowgreen" hs_color: + name: Hue/Sat color description: Color for the light in hue/sat format. Hue is 0-360 and Sat is 0-100. + advanced: true example: "[300, 70]" + selector: + object: xy_color: + name: XY-color description: Color for the light in XY-format. + advanced: true example: "[0.52, 0.43]" + selector: + object: color_temp: + name: Color temperature (mireds) description: Color temperature for the light in mireds. + advanced: true example: 250 + selector: + number: + min: 153 + max: 500 + step: 1 + unit_of_measurement: mireds + mode: slider kelvin: + name: Color temperature (Kelvin) description: Color temperature for the light in Kelvin. + advanced: true example: 4000 + selector: + number: + min: 2000 + max: 6500 + step: 100 + unit_of_measurement: K + mode: slider white_value: + name: White level description: Number between 0..255 indicating level of white. + advanced: true example: "250" + selector: + number: + min: 0 + max: 255 + step: 1 + mode: slider brightness: + name: Brightness value description: Number between 0..255 indicating brightness, where 0 turns the light off, 1 is the minimum brightness and 255 is the maximum brightness supported by the light. + advanced: true example: 120 + selector: + number: + min: 0 + max: 255 + step: 1 + mode: slider brightness_pct: + name: Brightness description: Number between 0..100 indicating percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness and 100 is the maximum brightness supported by the light. example: 47 + selector: + number: + min: 0 + max: 100 + step: 1 + unit_of_measurement: "%" + mode: slider profile: + name: Profile description: Name of a light profile to use. + advanced: true example: relax + selector: + text: flash: + name: Flash description: If the light should flash. Valid values are short and long. + advanced: true example: short values: - short - long + selector: + select: + options: + - long + - short effect: + name: Effect description: Light effect. example: random values: - colorloop - random + selector: + text: