Skip to content

Commit

Permalink
added debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreiter committed May 20, 2024
1 parent c0ae148 commit 1a36267
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ha-scenes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ blueprint:
### 2.5
- Added input `stop_when_lights_turn_off` to allow running the script continuously.
- Added input `debug` to generate debug messages in the log.
### 2.4
- It is now possible to also specify devices. If a device has multiple entities from the
Expand Down Expand Up @@ -189,6 +190,13 @@ blueprint:
default: true
selector:
boolean: null
debug:
name: Generate debug log output?
description: >-
If true, the script generates a few log messages.
default: false
selector:
boolean: null
mode: restart
fields:
scene:
Expand Down Expand Up @@ -324,6 +332,7 @@ variables:
skipgroups: !input skipgroups
transition: !input transition
stop_when_lights_turn_off: !input stop_when_lights_turn_off
debug: !input debug
scenes: |-
{% set scenes = {
"Blossom":{"colors":[[0.5119,0.4249],[0.3972,0.4025],[0.4419,0.4164],[0.2674,0.3018],[0.24,0.2761]]},
Expand Down Expand Up @@ -503,13 +512,29 @@ sequence:
value: "{{ scene }}"
target:
entity_id: !input report_entity
- if: "{{ debug }}"
then:
- service: logbook.log
data:
name: "{{ this.attributes.friendly_name }}"
message: >-
Running dynamic scene {{ scene }} with {{ lights|length }} lights: {{ lights|list }}.
entity_id: "{{ this.entity_id }}"
- repeat:
while: >-
{{ repeat.index == 1 or (
(repeat_delay.hours > 0 or repeat_delay.minutes > 0 or repeat_delay.seconds > 0) and
(( lights | list | count ) == (lights | select('is_state', 'on') | list | count))
) }}
sequence:
- if: "{{ debug }}"
then:
- service: logbook.log
data:
name: "{{ this.attributes.friendly_name }}"
message: >-
Entering loop {{ repeat.index }}
entity_id: "{{ this.entity_id }}"
- variables:
colors: |-
# shuffle color order
Expand Down

0 comments on commit 1a36267

Please sign in to comment.