From 2dfbd4fbcf1069e18328bf63328ebe8f5942e11c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 18 Feb 2021 12:24:58 +0100 Subject: [PATCH] Add selectors to Fan service definitions (#46639) --- homeassistant/components/fan/services.yaml | 106 +++++++++++++-------- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/homeassistant/components/fan/services.yaml b/homeassistant/components/fan/services.yaml index 760aaabcf4a..2f5802b69f7 100644 --- a/homeassistant/components/fan/services.yaml +++ b/homeassistant/components/fan/services.yaml @@ -1,80 +1,102 @@ # Describes the format for available fan services set_speed: - description: Sets fan speed. + description: Set fan speed + target: fields: - entity_id: - description: Name(s) of the entities to set - example: "fan.living_room" speed: - description: Speed setting + name: Speed + description: Speed setting. + required: true example: "low" + selector: + text: set_preset_mode: - description: Set preset mode for a fan device. + description: Set preset mode for a fan device + target: fields: - entity_id: - description: Name(s) of entities to change. - example: "fan.kitchen" preset_mode: - description: New value of preset mode + name: Preset mode + description: New value of preset mode. + required: true example: "auto" + selector: + text: set_percentage: - description: Sets fan speed percentage. + description: Set fan speed percentage + target: fields: - entity_id: - description: Name(s) of the entities to set - example: "fan.living_room" percentage: - description: Percentage speed setting + name: Percentage + description: Percentage speed setting. + required: true example: 25 + selector: + number: + min: 0 + max: 100 + step: 1 + unit_of_measurement: "%" + mode: slider turn_on: - description: Turns fan on. + description: Turn fan on + target: fields: - entity_id: - description: Names(s) of the entities to turn on - example: "fan.living_room" speed: - description: Speed setting + name: Speed + description: Speed setting. example: "high" percentage: - description: Percentage speed setting + name: Percentage + description: Percentage speed setting. example: 75 + selector: + number: + min: 0 + max: 100 + step: 1 + unit_of_measurement: "%" + mode: slider preset_mode: - description: Preset mode setting + name: Preset mode + description: Preset mode setting. example: "auto" + selector: + text: turn_off: - description: Turns fan off. - fields: - entity_id: - description: Names(s) of the entities to turn off - example: "fan.living_room" + description: Turn fan off + target: oscillate: - description: Oscillates the fan. + description: Oscillate the fan + target: fields: - entity_id: - description: Name(s) of the entities to oscillate - example: "fan.desk_fan" oscillating: - description: Flag to turn on/off oscillation + name: Oscillating + description: Flag to turn on/off oscillation. + required: true example: true + selector: + boolean: toggle: - description: Toggle the fan on/off. - fields: - entity_id: - description: Name(s) of the entities to toggle - example: "fan.living_room" + description: Toggle the fan on/off + target: set_direction: - description: Set the fan rotation. + description: Set the fan rotation + target: fields: - entity_id: - description: Name(s) of the entities to set - example: "fan.living_room" direction: - description: The direction to rotate. Either 'forward' or 'reverse' + name: Direction + description: The direction to rotate. + required: true example: "forward" + selector: + select: + options: + - "forward" + - "reverse"