Skip to content

Add support for direction to fan template#14371

Merged
fabaff merged 2 commits into
home-assistant:devfrom
schmittx:fan-template-direction-support
May 14, 2018
Merged

Add support for direction to fan template#14371
fabaff merged 2 commits into
home-assistant:devfrom
schmittx:fan-template-direction-support

Conversation

@schmittx
Copy link
Copy Markdown
Contributor

@schmittx schmittx commented May 10, 2018

Description:

Adds support for direction to fan template

Related issue (if applicable): N/A

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5342

Example entry for configuration.yaml (if applicable):

fan:
  - platform: template
    fans:
      bedroom_fan:
        friendly_name: "Bedroom fan" #Optional
        value_template: "{{ states('input_boolean.state') }}" #Required
        speed_template: "{{ states('input_select.speed') }}" #Optional
        oscillating_template: "{{ states('input_select.osc') }}" #Optional
        direction_template: "{{ states('input_select.direction') }}" #Optional
        turn_on: #Required
          service: script.fan_on
        turn_off: #Required
          service: script.fan_off
        set_speed: #Optional
          service: script.fan_speed
          data_template:
            speed: "{{ speed }}"
        set_oscillating: #Optional
          service: script.fan_oscillating
          data_template:
            oscillating: "{{ oscillating }}"
        set_direction: #Optional
          service: script.fan_direction
          data_template:
            direction: "{{ direction }}"
        speeds: #Optional
          - '1'
          - '2'
          - '3'

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🐦

@fabaff fabaff merged commit 44e9783 into home-assistant:dev May 14, 2018
@balloob balloob mentioned this pull request May 28, 2018
@schmittx schmittx deleted the fan-template-direction-support branch June 2, 2018 00:03
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants