Skip to content

Include both old and new entities for a step-wise introduction of water_heaters in HA#895

Merged
bouwew merged 52 commits into
mainfrom
revert-wh-names
Jul 13, 2026
Merged

Include both old and new entities for a step-wise introduction of water_heaters in HA#895
bouwew merged 52 commits into
mainfrom
revert-wh-names

Conversation

@bouwew

@bouwew bouwew commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for new maximum boiler and domestic hot water temperature controls.
    • Added water_temperature readings to compatible heating and cooling devices.
    • Added domestic hot water comfort switch support (dhw_cm_switch) where available.
    • Improved DHW mode handling to work with the newer temperature control model.
  • Bug Fixes
    • Updated device data handling so legacy and current devices expose the correct temperature fields and switches consistently.
  • Chores / Tests
    • Updated fixtures, test data, and expected entity counts to match the revised data shape.
  • Documentation
    • Added a changelog entry for the upcoming water_heaters introduction (v1.14.0a0).

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 12, 2026

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json (1)

13-39: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

UPDATED_DATA fixture is missing new schema fields present in the base fixture.

anna_heatpump_heating_UPDATED_DATA.json (device 1cbf783bb11e4a7c8a6843dee3a86927) is inconsistent with its base fixture anna_heatpump_heating.json:

  • Missing max_dhw_temperature (base has it at lines 38–44).
  • Missing sensors.water_temperature (base has it at line 60).
  • Uses select_dhw_mode (line 28) instead of dhw_mode (base uses dhw_mode at line 32).

Since UPDATED_DATA represents the same device after a state refresh, it should match the base fixture's schema. These omissions will cause test assertions against the new fields to fail or be silently skipped.

🔧 Proposed fix to align UPDATED_DATA with the base fixture schema
     "location": "a57efe5f145f498c9be62a9b63626fbf",
+    "max_dhw_temperature": {
+      "current": 46.3,
+      "lower_bound": 35.0,
+      "resolution": 0.01,
+      "setpoint": 53.0,
+      "upper_bound": 60.0
+    },
     "maximum_boiler_temperature": {
       "current": 29.1,
       "setpoint": 60.0,
       "lower_bound": 0.0,
       "upper_bound": 100.0,
       "resolution": 1.0
     },
     "model": "Generic heater/cooler",
     "name": "OpenTherm",
-    "select_dhw_mode": "eco",
+    "dhw_mode": "eco",
     "sensors": {
       "intended_boiler_temperature": 35.0,
       "modulation_level": 52,
       "return_temperature": 25.1,
       "water_pressure": 1.57,
-      "outdoor_air_temperature": 3.0
+      "outdoor_air_temperature": 3.0,
+      "water_temperature": 29.1
     },
     "switches": {
       "dhw_cm_switch": false
     },
🤖 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 `@tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json` around lines 13 -
39, Update the anna_heatpump_heating_UPDATED_DATA fixture for device
1cbf783bb11e4a7c8a6843dee3a86927 to match the base fixture schema: add
max_dhw_temperature, add sensors.water_temperature, and rename select_dhw_mode
to dhw_mode. Preserve the existing values and structure while aligning these
fields with anna_heatpump_heating.json.
🧹 Nitpick comments (1)
plugwise/common.py (1)

298-302: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update the stale docstring.

The docstring still references the old names dhw_temperature and boiler_temperature, and claims "the copied sensor data is removed." With the rename to max_dhw_temperature/maximum_boiler_temperature and the intentional retention of water_temperature in sensors, both claims are now inaccurate.

📝 Proposed docstring update
-    """Create dhw_temperature and boiler_temperature dicts.
-
-    The initial item-names are updated and a current key is added.
-    Also, the copied sensor data is removed.
-    """
+    """Create max_dhw_temperature and maximum_boiler_temperature dicts.
+
+    The initial item-names are updated and a current key is added.
+    The copied sensor data is removed for dhw_temperature, while
+    water_temperature is kept in sensors for step-wise introduction.
+    """
🤖 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/common.py` around lines 298 - 302, The docstring for the method
creating the temperature dictionaries is stale. Update it to reference
max_dhw_temperature and maximum_boiler_temperature, and describe the current
sensor-data behavior accurately by noting that water_temperature is retained in
sensors.
🤖 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 `@fixtures/m_adam_heating/data.json`:
- Around line 16-34: Update the fixture values for max_dhw_temperature.current
and maximum_boiler_temperature.current to 43.0, matching
sensors.water_temperature, while leaving the surrounding bounds, setpoints, and
sensor data unchanged.

---

Outside diff comments:
In `@tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json`:
- Around line 13-39: Update the anna_heatpump_heating_UPDATED_DATA fixture for
device 1cbf783bb11e4a7c8a6843dee3a86927 to match the base fixture schema: add
max_dhw_temperature, add sensors.water_temperature, and rename select_dhw_mode
to dhw_mode. Preserve the existing values and structure while aligning these
fields with anna_heatpump_heating.json.

---

Nitpick comments:
In `@plugwise/common.py`:
- Around line 298-302: The docstring for the method creating the temperature
dictionaries is stale. Update it to reference max_dhw_temperature and
maximum_boiler_temperature, and describe the current sensor-data behavior
accurately by noting that water_temperature is retained in sensors.
🪄 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: e370258b-bcdb-46b4-a0fe-5b2299329a43

📥 Commits

Reviewing files that changed from the base of the PR and between aef6e39 and 51f0d0f.

📒 Files selected for processing (67)
  • fixtures/adam_bad_thermostat/data.json
  • fixtures/adam_heatpump_cooling/data.json
  • fixtures/adam_jip/data.json
  • fixtures/adam_onoff_cooling_fake_firmware/data.json
  • fixtures/adam_plus_anna/data.json
  • fixtures/adam_plus_anna_new/data.json
  • fixtures/adam_plus_anna_new_regulation_off/data.json
  • fixtures/anna_elga_2/data.json
  • fixtures/anna_elga_2_cooling/data.json
  • fixtures/anna_elga_2_schedule_off/data.json
  • fixtures/anna_elga_no_cooling/data.json
  • fixtures/anna_heatpump_cooling/data.json
  • fixtures/anna_heatpump_cooling_fake_firmware/data.json
  • fixtures/anna_heatpump_heating/data.json
  • fixtures/anna_loria_cooling_active/data.json
  • fixtures/anna_loria_driessens/data.json
  • fixtures/anna_loria_heating_idle/data.json
  • fixtures/anna_p1/data.json
  • fixtures/anna_v4/data.json
  • fixtures/anna_v4_dhw/data.json
  • fixtures/anna_v4_no_tag/data.json
  • fixtures/legacy_anna/data.json
  • fixtures/legacy_anna_2/data.json
  • fixtures/m_adam_cooling/data.json
  • fixtures/m_adam_heating/data.json
  • fixtures/m_adam_heating_off_schedule/data.json
  • fixtures/m_adam_jip/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • plugwise/common.py
  • plugwise/constants.py
  • plugwise/data.py
  • plugwise/helper.py
  • plugwise/legacy/helper.py
  • plugwise/smile.py
  • scripts/manual_fixtures.py
  • tests/data/adam/adam_bad_thermostat.json
  • tests/data/adam/adam_heatpump_cooling.json
  • tests/data/adam/adam_jip.json
  • tests/data/adam/adam_onoff_cooling_fake_firmware.json
  • tests/data/adam/adam_plus_anna.json
  • tests/data/adam/adam_plus_anna_new.json
  • tests/data/adam/adam_plus_anna_new_regulation_off.json
  • tests/data/anna/anna_elga_2.json
  • tests/data/anna/anna_elga_2_cooling.json
  • tests/data/anna/anna_elga_2_cooling_UPDATED_DATA.json
  • tests/data/anna/anna_elga_2_schedule_off.json
  • tests/data/anna/anna_elga_no_cooling.json
  • tests/data/anna/anna_heatpump_cooling.json
  • tests/data/anna/anna_heatpump_cooling_fake_firmware.json
  • tests/data/anna/anna_heatpump_heating.json
  • tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json
  • tests/data/anna/anna_loria_cooling_active.json
  • tests/data/anna/anna_loria_driessens.json
  • tests/data/anna/anna_loria_heating_idle.json
  • tests/data/anna/anna_p1.json
  • tests/data/anna/anna_v4.json
  • tests/data/anna/anna_v4_UPDATED_DATA.json
  • tests/data/anna/anna_v4_dhw.json
  • tests/data/anna/anna_v4_no_tag.json
  • tests/data/anna/anna_without_boiler_fw441.json
  • tests/data/anna/legacy_anna.json
  • tests/data/anna/legacy_anna_2.json
  • tests/test_adam.py
  • tests/test_anna.py
  • tests/test_init.py
  • tests/test_legacy_anna.py

Comment thread fixtures/m_adam_heating/data.json Outdated
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aef6e39) to head (f877fc5).
⚠️ Report is 53 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #895   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3503      3504    +1     
=========================================
+ Hits          3503      3504    +1     

☔ 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.

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 `@pyproject.toml`:
- Line 7: Align the package version in the pyproject version setting with the
changelog’s v1.14.0 release label. Update the prerelease value so published
metadata consistently represents the intended stable release.
🪄 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: 9c0bb495-5961-4bd7-a995-352e1c44e552

📥 Commits

Reviewing files that changed from the base of the PR and between 51f0d0f and 546ec33.

📒 Files selected for processing (26)
  • CHANGELOG.md
  • fixtures/adam_bad_thermostat/data.json
  • fixtures/adam_heatpump_cooling/data.json
  • fixtures/adam_onoff_cooling_fake_firmware/data.json
  • fixtures/anna_elga_no_cooling/data.json
  • fixtures/anna_heatpump_heating/data.json
  • fixtures/anna_loria_cooling_active/data.json
  • fixtures/anna_loria_driessens/data.json
  • fixtures/anna_loria_heating_idle/data.json
  • fixtures/m_adam_heating/data.json
  • fixtures/m_adam_heating_off_schedule/data.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • plugwise/common.py
  • pyproject.toml
  • scripts/manual_fixtures.py
  • tests/data/adam/adam_bad_thermostat.json
  • tests/data/adam/adam_heatpump_cooling.json
  • tests/data/adam/adam_onoff_cooling_fake_firmware.json
  • tests/data/anna/anna_elga_no_cooling.json
  • tests/data/anna/anna_heatpump_heating.json
  • tests/data/anna/anna_loria_cooling_active.json
  • tests/data/anna/anna_loria_driessens.json
  • tests/data/anna/anna_loria_heating_idle.json
  • tests/test_adam.py
  • tests/test_anna.py
🚧 Files skipped from review as they are similar to previous changes (23)
  • fixtures/anna_elga_no_cooling/data.json
  • fixtures/adam_bad_thermostat/data.json
  • tests/data/anna/anna_elga_no_cooling.json
  • tests/data/anna/anna_loria_heating_idle.json
  • plugwise/common.py
  • fixtures/anna_loria_heating_idle/data.json
  • fixtures/m_adam_heating_off_schedule/data.json
  • tests/test_adam.py
  • fixtures/m_adam_heating/data.json
  • fixtures/m_anna_heatpump_idle/data.json
  • tests/data/adam/adam_onoff_cooling_fake_firmware.json
  • tests/data/anna/anna_loria_cooling_active.json
  • fixtures/m_anna_heatpump_cooling/data.json
  • tests/data/anna/anna_heatpump_heating.json
  • fixtures/adam_onoff_cooling_fake_firmware/data.json
  • tests/test_anna.py
  • scripts/manual_fixtures.py
  • tests/data/anna/anna_loria_driessens.json
  • tests/data/adam/adam_bad_thermostat.json
  • fixtures/adam_heatpump_cooling/data.json
  • fixtures/anna_loria_driessens/data.json
  • tests/data/adam/adam_heatpump_cooling.json
  • fixtures/anna_loria_cooling_active/data.json

Comment thread pyproject.toml Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@bouwew bouwew marked this pull request as ready for review July 13, 2026 17:18
@bouwew bouwew requested a review from a team as a code owner July 13, 2026 17:18
@bouwew bouwew merged commit 01725c4 into main Jul 13, 2026
15 of 16 checks passed
@bouwew bouwew deleted the revert-wh-names branch July 13, 2026 17:19
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.

1 participant