From 561ece7fe449f13476e086d6efac56d508790194 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Sat, 25 May 2019 13:28:07 -0400 Subject: [PATCH] minor updates --- packages/batteries.yaml | 4 ++-- packages/homesecurity.yaml | 4 ++-- packages/usps.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/batteries.yaml b/packages/batteries.yaml index 2844f0c..37c9c3d 100644 --- a/packages/batteries.yaml +++ b/packages/batteries.yaml @@ -361,8 +361,8 @@ automation: condition: - condition: template value_template: > - {%- if states.automation.alert_when_moving.attributes.last_triggered -%} - {{ (as_timestamp(now()) - as_timestamp(states.automation.alert_when_moving.attributes.last_triggered)) > 300 }} + {%- if state_attr('automation.alert_when_moving', 'last_triggered') -%} + {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.alert_when_moving', 'last_triggered'))) > 300 }} {%- else -%} true {%- endif -%} diff --git a/packages/homesecurity.yaml b/packages/homesecurity.yaml index db9f41b..5670861 100644 --- a/packages/homesecurity.yaml +++ b/packages/homesecurity.yaml @@ -86,8 +86,8 @@ automation: value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" - condition: template value_template: > - {%- if states.automation.notify_home_security_status_change.attributes.last_triggered -%} - {{ (as_timestamp(now()) - as_timestamp(states.automation.notify_home_security_status_change.attributes.last_triggered)) > 90 }} + {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%} + {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }} {%- else -%} true {%- endif -%} diff --git a/packages/usps.yaml b/packages/usps.yaml index d40b1dc..1e5899f 100644 --- a/packages/usps.yaml +++ b/packages/usps.yaml @@ -68,7 +68,7 @@ automation: category: camera entity_id: "camera.usps_mail_pictures" attachment: - url: "{{ states.camera.usps_mail_pictures.attributes.entity_picture }}" + url: "{{ state_attr('camera.usps_mail_pictures', 'entity_picture') }}" content-type: jpg # Notify USPS packages via TTS. Usually there are no pictures for packages