-
Notifications
You must be signed in to change notification settings - Fork 184
/
frontend.yaml
executable file
·50 lines (48 loc) · 1.46 KB
/
frontend.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
#-
# __ _ _
# / _|_ __ ___ _ __ | |_ ___ _ __ __| |
# | |_| '__/ _ \| '_ \| __/ _ \ '_ \ / _` |
# | _| | | (_) | | | | || __/ | | | (_| |
# |_| |_| \___/|_| |_|\__\___|_| |_|\__,_|
#
#
#- from github.com/basnijholt/home-assistant-config
- alias: "Frontend: turn on dark mode"
trigger:
- platform: time
at: "20:00"
- platform: sun
event: sunset
condition: "{{ is_state('input_boolean.dark_mode', 'off') }}"
action:
entity_id: input_boolean.dark_mode
service: input_boolean.turn_on
- alias: "Frontend: turn on light mode"
trigger:
- platform: time
at: "06:00"
- platform: sun
event: sunrise
condition: "{{ is_state('input_boolean.dark_mode', 'on') }}"
action:
entity_id: input_boolean.dark_mode
service: input_boolean.turn_off
- alias: "Frontend: change theme"
trigger:
- platform: state
entity_id: input_select.theme
- platform: state
entity_id: input_boolean.dark_mode
- platform: state
entity_id: input_boolean.theme_alternative
- platform: homeassistant
event: start
action:
service: frontend.set_theme
data:
name: >
{% set which = "dark" if is_state("input_boolean.dark_mode", "on") else "light" -%}
{% set name = states("input_select.theme") -%}
{% set suffix = "-alternative" if is_state("input_boolean.theme_alternative", "on") else "" -%}
ios-{{ which }}-mode-{{ name }}{{ suffix }}