Use is_state_attr

This commit is contained in:
2022-05-07 11:29:26 +03:00
parent dbba29e1ea
commit b39cc03642
4 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ switch:
switches:
tapo_bedroom:
friendly_name: "Bedroom Camera"
value_template: "{{ state_attr('camera.bedroom_hd', 'privacy_mode') == 'off' }}"
value_template: "{{ is_state_attr('camera.bedroom_hd', 'privacy_mode', 'off') }}"
turn_on:
service: script.tapo_bedroom_on
turn_off:
@@ -19,7 +19,7 @@ script:
tapo_bedroom_toggle:
sequence:
- choose:
- conditions: "{{ state_attr('camera.bedroom_hd', 'privacy_mode') == 'off' }}"
- conditions: "{{ is_state_attr('camera.bedroom_hd', 'privacy_mode', 'off') }}"
sequence:
- service: script.tapo_bedroom_off