Skip to content

Commit

Permalink
Minor improvements to new Hue scene logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsputman committed Dec 26, 2023
1 parent ace75a1 commit 0fafa30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/hue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ hue_activate_scene:
entity:
include_entities:
- sensor.hue_scene_living_room
- sensor.hue_scene_ensuite
- sensor.hue_scene_kitchen
- sensor.hue_scene_kitchen_counter_cupboards
- sensor.hue_scene_garden
Expand All @@ -35,8 +36,11 @@ hue_activate_scene:
<Unavailable>
{% endif %}
- if:
# The above `has_value(scene_entity)` guards against unknown/unavailable
# states, but it doesn't guard against an _uninitialised_ sensor – hence
# the `has_value(scene_id)`, which filters out that edge case...
- >-
{{ scene_id != '<Unavailable>' }}
{{ scene_id != '<Unavailable>' and has_value(scene_id) }}
then:
- service: scene.turn_on
target:
Expand Down
2 changes: 1 addition & 1 deletion templates/hue_scenes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
'event.hue_tap_dial_switch_1_button_3'
]
%}
Active
Bright
{% endif %}
{% else %}
{{ this.state }}
Expand Down

0 comments on commit 0fafa30

Please sign in to comment.