#1553 - Fixed new rounding function for local_calibration #1555
+30
−27
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.
Seems "local_calibration_steps" is bad naming in our code, and actually refering to the step (size), not the number of steps. Therefore the new round_by_steps is "wrong" in local calibration mode, as the opposite was assumed. Issue wasn't apparent in my test, since I didn't have a TRV with local calibration yet.
Motivation:
Fix bug - right now we round by the inverse of step size - e.g. 0.1° step = 10°C steps 😅
Changes:
Renamed "steps" to "step" (target_temp_step also was already a step and not steps, even though apparently they're both supposed to be the same thing) and corrected new rounding code, and made sure the function documentation is clear now.
Related issue (check one):
Checklist (check one):
Test-Hardware list (for code changes)
HA Version: 2024.12
Zigbee2MQTT Version: N/A (ZHA)
TRV Hardware: Bosch RBSH-TRV0-ZB-EU (Radiator Thermostat II)