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

fix to avoid looping indefinitely when moving to finalValue when equal to current value #9776

Merged

Conversation

mkardous-silabs
Copy link
Contributor

@mkardous-silabs mkardous-silabs commented Sep 17, 2021

Problem

When calculating transitionTime from current value and final value, if current and final value are equal, transitionTime ends up being equal to 0 and causes the application to indefinitely try to get to the final value when current value is equal to the final value.

Change overview

Added a check when calculating transitionTime that if current value and final value are the same, sets the transitionTime to 1. This forces the normal execution to happen for one iteration.

Testing

  • Automated testing to validate that previous features were not affected
  • Manual testing to validate specific test case where current and final value are equal

@boring-cyborg boring-cyborg bot added the app label Sep 17, 2021
@mkardous-silabs mkardous-silabs changed the title fix to avoid looping indefinitely when requesting to move to finalVal… fix to avoid looping indefinitely when moving to finalValue which is equal to current Sep 17, 2021
@mkardous-silabs mkardous-silabs changed the title fix to avoid looping indefinitely when moving to finalValue which is equal to current fix to avoid looping indefinitely when moving to finalValue when equal to current value Sep 17, 2021
Checks if transitionTime is equal 0 after calculations
@andy31415 andy31415 merged commit 4059bbe into project-chip:master Sep 17, 2021
mleisner pushed a commit to mleisner/connectedhomeip that referenced this pull request Sep 20, 2021
…l to current value (project-chip#9776)

* fix to avoid looping indefinitely when requesting to move to finalValue when equal to currentValue

* Moved fix to cover more cases
Checks if transitionTime is equal 0 after calculations

* restyle

* changed check to remove max function
@mkardous-silabs mkardous-silabs deleted the fix/max_transition_time branch October 19, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants