Skip to content

Improve compatibility between set-functions#897

Merged
bouwew merged 21 commits into
mainfrom
fix-manual-ficture-script
Jul 17, 2026
Merged

Improve compatibility between set-functions#897
bouwew merged 21 commits into
mainfrom
fix-manual-ficture-script

Conversation

@bouwew

@bouwew bouwew commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Also improve manual fixture creation.

--> Breaking changes:

  • set_select() arguments have been reordered
  • set_dhw_mode() arguments have been reordered

Summary by CodeRabbit

Summary by CodeRabbit

  • Enhancements

    • Improved thermostat schedule handling for more consistent on/off behavior, including safer handling when optional values are omitted.
    • Adjusted domestic hot water mode control for more consistent parameter ordering.
  • Bug Fixes

    • Added stricter validation so invalid schedule states are rejected.
  • Documentation/Chores

    • Updated to version v1.14.1 and refreshed manual fixture sensor readings for cooling/heat-pump scenarios.
    • Updated related tests to match the revised control behavior.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2fc05b2-c12c-42e7-a73c-8b0de3e295e1

📥 Commits

Reviewing files that changed from the base of the PR and between 90f169b and 205dfd7.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • fixtures/m_adam_cooling/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • plugwise/__init__.py
  • plugwise/legacy/smile.py
  • plugwise/smile.py
  • pyproject.toml
  • scripts/manual_fixtures.py
  • tests/test_adam.py
  • tests/test_init.py
🚧 Files skipped from review as they are similar to previous changes (9)
  • pyproject.toml
  • CHANGELOG.md
  • fixtures/m_anna_heatpump_idle/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • tests/test_init.py
  • plugwise/legacy/smile.py
  • plugwise/smile.py
  • plugwise/init.py
  • fixtures/m_adam_cooling/data.json

📝 Walkthrough

Walkthrough

The PR aligns schedule-state and DHW method argument ordering across public and legacy APIs, updates schedule OFF/NONE handling and validation, refreshes related tests, updates package metadata, and refreshes manual fixture sensor values.

Changes

Schedule and DHW API alignment

Layer / File(s) Summary
API contract and forwarding
plugwise/__init__.py, plugwise/smile.py, plugwise/legacy/smile.py, tests/test_init.py
Schedule and DHW methods use updated parameter ordering, optional state values, and keyword-based forwarding.
Schedule-state handling and validation
plugwise/smile.py, tests/test_adam.py
Schedule OFF/NONE handling, state validation, context generation, previous-state comparisons, bookkeeping, and related test scenarios are updated.
Manual fixture generation and release metadata
scripts/manual_fixtures.py, fixtures/..., CHANGELOG.md, pyproject.toml
Manual fixture sensor values, changelog text, and the package version are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: compatech

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the API argument-order changes, but it is too vague to clearly convey the main change. Rename it to mention the specific set-function compatibility change, such as reordering set_select and set_dhw_mode arguments.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-manual-ficture-script

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from CoMPaTech July 16, 2026 16:27
@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9eb4561) to head (205dfd7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #897   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3504      3508    +4     
=========================================
+ Hits          3504      3508    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
plugwise/smile.py (1)

349-350: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Align parameter defaults with the public API and legacy implementation.

For consistency with the public API in plugwise/__init__.py and the legacy implementation in plugwise/legacy/smile.py, consider adding = None as the default value for the name parameter. This ensures the method signatures strictly match across the backend and frontend boundaries.

💡 Proposed fix
     async def set_schedule_state(
-        self, loc_id: str, name: str | None, state: str | None = None
+        self, loc_id: str, name: str | None = None, state: str | None = None
     ) -> None:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugwise/smile.py` around lines 349 - 350, Update the affected method
signature in the Smile implementation to make the name parameter optional with a
None default, matching the public API and legacy Smile implementation while
preserving the existing loc_id and state parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@plugwise/smile.py`:
- Around line 349-350: Update the affected method signature in the Smile
implementation to make the name parameter optional with a None default, matching
the public API and legacy Smile implementation while preserving the existing
loc_id and state parameters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a09017da-3744-4af6-806c-3cb7b4a22740

📥 Commits

Reviewing files that changed from the base of the PR and between 8be4417 and c486f39.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • fixtures/m_adam_cooling/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • plugwise/__init__.py
  • plugwise/legacy/smile.py
  • plugwise/smile.py
  • scripts/manual_fixtures.py
  • tests/test_adam.py
  • tests/test_init.py

@bouwew
bouwew marked this pull request as ready for review July 16, 2026 17:13
@bouwew
bouwew requested a review from a team as a code owner July 16, 2026 17:13
@bouwew
bouwew force-pushed the fix-manual-ficture-script branch from 70efe8c to 90f169b Compare July 16, 2026 17:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_init.py`:
- Line 747: Update the call to api.set_select in the test helper to pass the
existing state argument along with select_schedule, loc_id, and new_schedule.
Preserve the helper’s on/off transition coverage by ensuring the accepted state
value reaches the API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b09c0886-b1b9-48c7-bb9a-44246163a44e

📥 Commits

Reviewing files that changed from the base of the PR and between c486f39 and 90f169b.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • fixtures/m_adam_cooling/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • plugwise/__init__.py
  • plugwise/legacy/smile.py
  • plugwise/smile.py
  • pyproject.toml
  • scripts/manual_fixtures.py
  • tests/test_adam.py
  • tests/test_init.py
🚧 Files skipped from review as they are similar to previous changes (8)
  • CHANGELOG.md
  • tests/test_adam.py
  • scripts/manual_fixtures.py
  • fixtures/m_adam_cooling/data.json
  • plugwise/init.py
  • fixtures/m_anna_heatpump_cooling/data.json
  • plugwise/smile.py
  • plugwise/legacy/smile.py

Comment thread tests/test_init.py
@bouwew
bouwew force-pushed the fix-manual-ficture-script branch from 90f169b to 205dfd7 Compare July 17, 2026 05:48
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai
coderabbitai Bot requested a review from CoMPaTech July 17, 2026 05:50
@bouwew
bouwew merged commit ce32275 into main Jul 17, 2026
18 checks passed
@bouwew
bouwew deleted the fix-manual-ficture-script branch July 17, 2026 05:58
@bouwew bouwew changed the title improve compatibility between set-functions Improve compatibility between set-functions Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants