Cover: Fix auto-stopping without position state #482
Merged
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
Fixes auto-stopping covers without position state. Due to processing every (outgoing) telegram in every device we did overwrite the target position with the end position.
Eg. when we want from closed to 50% an UP-Telegram is sent to the bus (because we have no position address) and when reaching 50% a stop() shall be called. When processing this (outgoing) UP-Telegram we were treating it like any UP so target position became 0%.
Now we check if the cover is already moving in the received direction and ignore the telegram if it is.
This implies that also signals from the bus are ignored when the cover is currently travelling in the same direction, to a distinct position from xknx - which is a very rare scenario imho.
Fixes #481
Type of change
Checklist: