-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[avmfritz] Fix boost and window open modes #19118
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
Conversation
Signed-off-by: Andrew Fiddian-Green <[email protected]>
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/fritz-binding-dect302-smartthermo302/165280/11 |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/fritz-binding-dect302-smartthermo302/165280/30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issues with boost and window open mode detection in the AVM Fritz binding for thermostats. The fix addresses two core problems: BigDecimal comparison issues where scale differences caused incorrect equality checks, and logic precedence where boost/window open states were evaluated after other modes.
- Replaced
BigDecimal.equals()withBigDecimal.compareTo()to handle scale differences correctly - Reordered evaluation logic to prioritize boost and window open modes
- Added comprehensive test coverage for the fixed functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| HeatingModel.java | Fixed BigDecimal comparisons and reordered mode evaluation logic to properly detect boost and window open states |
| HeatingModelTest.java | Added test cases to verify boost and window open mode detection works correctly |
cweitkamp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for fixing. Makes sense to rearrange the order of heating mode determination.
lsiepel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
* fix boost and window open modes Signed-off-by: Andrew Fiddian-Green <[email protected]>
* fix boost and window open modes Signed-off-by: Andrew Fiddian-Green <[email protected]>
* fix boost and window open modes Signed-off-by: Andrew Fiddian-Green <[email protected]>
* fix boost and window open modes Signed-off-by: Andrew Fiddian-Green <[email protected]>
* fix boost and window open modes Signed-off-by: Andrew Fiddian-Green <[email protected]> Signed-off-by: Ciprian Pascu <[email protected]>
See for https://community.openhab.org/t/fritz-binding-dect302-smartthermo302/165280/1
Fixes #17554
Consider backporting to v4.3.x
Tip for reviewer: there seems to have been two issues
BigDecimal.equals()depends on the scale of the two values .. so1.00is not the same as1.0. => The code has been changed to useBigDecimal.compareTo()which does not depend on scale.Jar files for testing
Test result:
Signed-off-by: Andrew Fiddian-Green [email protected]