Ignore attribute changes in automation trigger from/to#7651
Merged
Conversation
This makes it somewhat easier to read if the suggestion happens to be named "to".
Contributor
Author
|
I have added a test and updated the documentation. I am happy with this now but would appreciate a review from @armills. (Note: it turned out that |
emlove
approved these changes
May 20, 2017
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This changes
from/tofilters on automation triggers to only consider actual state changes, not attribute updates. The change only makes a difference if just one offrom/tois specified.Using
stateas an alias oftois deprecated because it is ambiguous.These changes were agreed upon in #7556.
Related issue (if applicable): fixes #6299 #7556
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2665
Breaking change note 1: An automation state trigger that had only
fromorto(but not both) used to be triggered whenever state attributes changed, even if the actualfrom/tostate remained the same. This has been changed so thatfromandtowill only match when the state actually changes from or to the specified state.Breaking change note 2: The automation state trigger used to allow
stateas an alias forto. This naming was a bit confusing andstatehas now been deprecated.Example entry for
configuration.yaml(if applicable):This example no longer arms the alarm when GPS coordinates are updated while the device is home:
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices:
toxrun successfully.