renemarc/home-assistant-config

View on GitHub
automations/devices/kiosk_low.yaml

Summary

Maintainability
Test Coverage
#
# Toggle kiosk display's brightness
#
# @subscribe input_boolean.low_mode
#
- id: kiosk_low_power
  alias: "Kiosk LOW POWER"

  trigger:
    # When low-power mode is changed.
    - platform: state
      entity_id: input_boolean.low_mode

  action:
    # Dim/brighten display.
    - service: shell_command.kiosk_brightness
      data:
        host: !secret fully_kiosk_host
        port: !secret fully_kiosk_port
        password: !secret fully_kiosk_password
      data_template:
        value: >-
          {% if is_state('input_boolean.low_mode', 'off') %}
            255
          {% else %}
            0
          {% endif %}