Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions homeassistant/components/automation/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def async_trigger(hass, config, action):
time_delta = config.get(CONF_FOR)
async_remove_state_for_cancel = None
async_remove_state_for_listener = None
match_all = (from_state == MATCH_ALL and to_state == MATCH_ALL)

@callback
def clear_listener():
Expand Down Expand Up @@ -77,8 +78,8 @@ def call_action():
})

# Ignore changes to state attributes if from/to is in use
match_all = (from_state == MATCH_ALL and to_state == MATCH_ALL)
if not match_all and from_s.last_changed == to_s.last_changed:
if (not match_all and from_s is not None and to_s is not None and
from_s.last_changed == to_s.last_changed):
return

if time_delta is None:
Expand Down