Change detection common conditions #7670
Closed
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.
Objective
Add some new run condition generators to the
common_conditions
module for checking the change detection of a certain resource or state.Changelog
Added
resource_added<T: Resource>
resource_changed<T: Resource>
resource_exsits_and_changed<T: Resource>
resource_added<T: Resource>
state_changed<T: States>
I have not added the rest of the methods for states because as far as I can tell you can't add them at run time, please let me know if I am wrong and I will add them too.
Another note, the fact that
state_change
will trigger even when the state was set to the same variant it already had makes me hesitant on whether to keep it as it could be a bit misleading, some opinions on this would be great.