Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover: Fix auto-stopping without position state #482

Merged
merged 3 commits into from Oct 26, 2020

Conversation

farmio
Copy link
Member

@farmio farmio commented Oct 25, 2020

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • The documentation has been adjusted accordingly
  • The changes generate no new warnings
  • Tests have been added that prove the fix is effective or that the feature works
  • The changes are documented in the changelog
  • The Homeassistant plugin has been adjusted in case of new config options

@farmio
Copy link
Member Author

farmio commented Oct 25, 2020

Please Squash-merge. I forgot to update changelog.

@coveralls
Copy link

coveralls commented Oct 25, 2020

Coverage Status

Coverage increased (+0.002%) to 93.75% when pulling 272cc21 on farmio:fix-cover-auto-stop into 785d73b on XKNX:master.

Copy link
Member

@marvin-w marvin-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine imho. Adding some tests might be useful so that it doesn't break again in the future.

@farmio farmio merged commit 4a6535c into XKNX:master Oct 26, 2020
@farmio farmio deleted the fix-cover-auto-stop branch October 26, 2020 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cover.set_cover_position not stopping with no position_address
3 participants