renemarc/home-assistant-config

View on GitHub
automations/devices/aurora_brightness.yaml

Summary

Maintainability
Test Coverage
#
# Change Nanoleaf Aurora's brightness
#
# @subscribe variable.aurora_brightness
#
# @see /automations/devices/aurora_schedule.yaml
# @see /lights/nanoleaf.yaml
#
- id: aurora_brightness
  alias: "Aurora BRIGHTNESS"

  trigger:
    # When a brightness level is changed.
    - platform: state
      entity_id: variable.aurora_brightness

  action:
    # Set the Aurora's brightness according to the new level.
    - service: light.turn_on
      data:
        entity_id:
          - light.aurora
      data_template:
        brightness: "{{ states('variable.aurora_brightness') }}"