Skip to content

Conversation

@andrewfg
Copy link
Contributor

@andrewfg andrewfg commented Aug 6, 2025

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

  1. The result of BigDecimal.equals() depends on the scale of the two values .. so 1.00 is not the same as 1.0. => The code has been changed to use BigDecimal.compareTo() which does not depend on scale.
  2. The logic precedence sequence was returning on/off/comfort/eco before the boost or window open states could be evaluated. => The logic precedence has been changed.

Jar files for testing

Test result:

  • User has confirmed the functionality here

Signed-off-by: Andrew Fiddian-Green [email protected]

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@andrewfg andrewfg self-assigned this Aug 6, 2025
@andrewfg andrewfg requested a review from cweitkamp as a code owner August 6, 2025 11:05
@andrewfg andrewfg added bug An unexpected problem or unintended behavior of an add-on additional testing preferred The change works for the pull request author. A test from someone else is preferred though. labels Aug 6, 2025
@openhab-bot
Copy link
Collaborator

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]>
@andrewfg andrewfg removed the additional testing preferred The change works for the pull request author. A test from someone else is preferred though. label Aug 6, 2025
@andrewfg andrewfg requested a review from Copilot August 6, 2025 13:04

This comment was marked as resolved.

@andrewfg andrewfg requested a review from a team August 8, 2025 10:05
@openhab-bot
Copy link
Collaborator

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

@andrewfg andrewfg requested a review from Copilot August 8, 2025 14:54
Copy link
Contributor

Copilot AI left a 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() with BigDecimal.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

Copy link
Contributor

@cweitkamp cweitkamp left a 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.

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@lsiepel lsiepel merged commit e65acf1 into openhab:main Aug 14, 2025
2 checks passed
lsiepel pushed a commit that referenced this pull request Aug 14, 2025
* fix boost and window open modes

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@lsiepel lsiepel added the backported A PR that has been cherry-picked to a patch release branch label Aug 14, 2025
lsiepel pushed a commit that referenced this pull request Aug 14, 2025
* fix boost and window open modes

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@lsiepel lsiepel added the backported4 Backported patches to the 4.x branch. Used for constructing release notes. label Aug 14, 2025
rogrun pushed a commit to rogrun/openhab-addons that referenced this pull request Sep 3, 2025
* fix boost and window open modes

Signed-off-by: Andrew Fiddian-Green <[email protected]>
rogrun pushed a commit to rogrun/openhab-addons that referenced this pull request Sep 3, 2025
* fix boost and window open modes

Signed-off-by: Andrew Fiddian-Green <[email protected]>
cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Sep 6, 2025
* fix boost and window open modes

Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Ciprian Pascu <[email protected]>
@jlaur jlaur added this to the 5.1 milestone Nov 17, 2025
@andrewfg andrewfg deleted the fritz-boost-channel branch December 14, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported A PR that has been cherry-picked to a patch release branch backported4 Backported patches to the 4.x branch. Used for constructing release notes. bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[avmfritz] FRITZ!DECT 302: BoostMode not detected in radiator_mode channel in some case

5 participants