You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skip autotune samples when the heating curve is zero - #194
At a target and outside temperature of 20°C the heating-curve term is zero. Autotune divides by that term and raises ZeroDivisionError instead of ignoring a sample from which no coefficient can be inferred.
Return None for that undefined coefficient and skip the autotune sample before changing the derivative or history. Nonzero calculations remain unchanged.
Validation: Python 3.13.16 / Home Assistant 2026.2.3 with the unchanged requirements_test.txt. Six new zero-curve cases fail on the original source; the two nonzero controls pass. All eight pass after the repair, and the independent branch's complete pytest suite passes 15 tests. Cases cover both heating systems, fresh/restored history, and the next valid sample. Tests run in an isolated network namespace with sockets disabled except Unix sockets. No actual device or heating installation was exercised.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 68fc4f05-1300-4edb-bcb6-2b3a0f2e57ad
📥 Commits
Reviewing files that changed from the base of the PR and between 7d43560 and fac42d8.
📒 Files selected for processing: 2
custom_components/sat/heating_curve.py
tests/test_heating_curve.py
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Walkthrough
The heating-curve coefficient calculation now returns None when the calculated curve value is zero. Autotune exits without updating its state in that case. Tests cover zero and nonzero curves, including fresh and restored autotune history.
calculate_coefficient returns None for a zero curve, and autotune skips derivative calculation and state updates. Tests cover history preservation and expected nonzero coefficients.
The zero-curve sample can be skipped without interrupting autotuning. No actionable merge-blocking risk remains after normal checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: skipping autotune samples when the heating curve is zero.
Linked Issues check
Issue #183 requires safe handling when the heating curve is zero at target and outside temperature 20°C. calculate_coefficient now returns None before division when calculate() returns zero. `au…
Out of Scope Changes check
The pull request changes only custom_components/sat/heating_curve.py and adds focused tests in tests/test_heating_curve.py. The implementation and tests directly support issue #183. No unrelated c…
Full details: Linked Issues check
Explanation
Issue #183 requires safe handling when the heating curve is zero at target and outside temperature 20°C. calculate_coefficient now returns None before division when calculate() returns zero. autotune returns before changing the derivative or coefficient history. The added tests cover both heating systems, fresh and restored state, the next valid sample, and unchanged nonzero coefficients.
Full details: Out of Scope Changes check
Explanation
The pull request changes only custom_components/sat/heating_curve.py and adds focused tests in tests/test_heating_curve.py. The implementation and tests directly support issue #183. No unrelated change is shown.
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
At a target and outside temperature of 20°C the heating-curve term is zero. Autotune divides by that term and raises ZeroDivisionError instead of ignoring a sample from which no coefficient can be inferred.
Return None for that undefined coefficient and skip the autotune sample before changing the derivative or history. Nonzero calculations remain unchanged.
Validation: Python 3.13.16 / Home Assistant 2026.2.3 with the unchanged requirements_test.txt. Six new zero-curve cases fail on the original source; the two nonzero controls pass. All eight pass after the repair, and the independent branch's complete pytest suite passes 15 tests. Cases cover both heating systems, fresh/restored history, and the next valid sample. Tests run in an isolated network namespace with sockets disabled except Unix sockets. No actual device or heating installation was exercised.
Fixes #183.
Summary by CodeRabbit
Bug Fixes
Tests