home-assistant.io/source/_posts/2016-03-12-z-wave-pep257-templated-service-calls.markdown

3.2 KiB

title, description, date, date_formatted, author, author_twitter, categories
title description date date_formatted author author_twitter categories
0.15: Unforked Open Z-Wave, templated service calls, extended scene support and PEP257 compliance. Home Assistant 0.15 has arrived. 2016-03-12 10:55:00 -0800 March 12, 2016 Paulus Schoutsen balloob
Release-Notes
Core

Two weeks has past so here is 0.15! We have been focussing a lot on quality. Making sure the system is more stable and reliable. I usually try to highlight one cool thing in the release notes but this release has 4 exciting announcements!

  • @fabaff has upgraded the codebase to follow the PEP257 documentation standard.
  • @partofthething has migrated us to use the main Python Open Z-Wave library instead of our forked version.
  • To make our automations more powerful, @persandstrom added the option to use templates to dynamically create service calls. This works for automation, Alexa, universal media player, template switch. Learn more.
  • @MartinHjelmare has upgraded our scene support to now support all built-in services and components.

Besides bug fixes, this release also brings:

{% raw %}

# Example using templates for service and data in service call.
# Works for automation, Alexa, universal media player, template switch.
automation:
  - trigger:
      - platform: state
        entity_id: switch.bathroom
    action:
      service: >
        {% if is_state('switch.bathroom', 'on') %}
          switch.turn_on
        {% else %}
          switch.turn_off
        {% endif %}
      target:
        entity_id: switch.{{ states('input_select.is') }}

{% endraw %}

Backward-incompatible changes

  • Media Player: Attributes to call service play_media has been renamed to media_content_type and media_content_id, to match the corresponding media player state attributes. This change affects automations, scripts and scenes.