Skip to content

Commit

Permalink
Fix: Compare state to STATE_UNKNOWN, not time_format.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfind committed Mar 13, 2021
1 parent e17e45e commit 398ac4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/attributes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
if (attr == "last_triggered" or
attr == "last_changed") and time_format:

state_template = ("{{% if states('{0}') != '{2}' "
state_template = ("{{% if states('{0}') != '{3}' "
"and states('{0}') != '{4}' %}}\
{{{{ as_timestamp(state_attr('{0}', '{1}'))\
| int | timestamp_local()\
Expand Down

0 comments on commit 398ac4c

Please sign in to comment.