# Describes the format for available fan services
set_speed:
  name: Set speed
  description: Set fan speed.
  target:
    entity:
      domain: fan
  fields:
    speed:
      name: Speed
      description: Speed setting.
      required: true
      example: "low"
      selector:
        text:

set_preset_mode:
  name: Set preset mode
  description: Set preset mode for a fan device.
  target:
    entity:
      domain: fan
  fields:
    preset_mode:
      name: Preset mode
      description: New value of preset mode.
      required: true
      example: "auto"
      selector:
        text:

set_percentage:
  name: Set speed percentage
  description: Set fan speed percentage.
  target:
    entity:
      domain: fan
  fields:
    percentage:
      name: Percentage
      description: Percentage speed setting.
      required: true
      selector:
        number:
          min: 0
          max: 100
          unit_of_measurement: "%"

turn_on:
  name: Turn on
  description: Turn fan on.
  target:
    entity:
      domain: fan
  fields:
    speed:
      name: Speed
      description: Speed setting.
      example: "high"
      selector:
        text:
    percentage:
      name: Percentage
      description: Percentage speed setting.
      selector:
        number:
          min: 0
          max: 100
          unit_of_measurement: "%"
    preset_mode:
      name: Preset mode
      description: Preset mode setting.
      example: "auto"
      selector:
        text:

turn_off:
  name: Turn off
  description: Turn fan off.
  target:
    entity:
      domain: fan

oscillate:
  name: Oscillate
  description: Oscillate the fan.
  target:
    entity:
      domain: fan
  fields:
    oscillating:
      name: Oscillating
      description: Flag to turn on/off oscillation.
      required: true
      selector:
        boolean:

toggle:
  name: Toggle
  description: Toggle the fan on/off.
  target:
    entity:
      domain: fan

set_direction:
  name: Set direction
  description: Set the fan rotation.
  target:
    entity:
      domain: fan
  fields:
    direction:
      name: Direction
      description: The direction to rotate.
      required: true
      selector:
        select:
          options:
            - label: "Forward"
              value: "forward"
            - label: "Reverse"
              value: "reverse"

increase_speed:
  name: Increase speed
  description: Increase the speed of the fan by one speed or a percentage_step.
  target:
    entity:
      domain: fan
  fields:
    percentage_step:
      advanced: true
      required: false
      description: Increase speed by a percentage.
      selector:
        number:
          min: 0
          max: 100
          unit_of_measurement: "%"

decrease_speed:
  name: Decrease speed
  description: Decrease the speed of the fan by one speed or a percentage_step.
  target:
    entity:
      domain: fan
  fields:
    percentage_step:
      advanced: true
      required: false
      description: Decrease speed by a percentage.
      selector:
        number:
          min: 0
          max: 100
          unit_of_measurement: "%"
