Update state automation to work with new and deleted state changes

This commit is contained in:
Paulus Schoutsen 2017-05-20 22:34:53 -07:00
parent 70ea16bdc0
commit 3492545ec1

View File

@ -80,7 +80,8 @@ def async_trigger(hass, config, action):
return
# If only state attributes changed, ignore this event
if from_s.last_changed == to_s.last_changed:
if (from_s is not None and to_s is not None and
from_s.last_changed == to_s.last_changed):
return
@callback