-
Notifications
You must be signed in to change notification settings - Fork 7
Add support for Anna P1 #951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughBumps plugwise dependency and integration version, adds Anna P1 test fixture and data, removes an obsolete Anna heatpump fixture, updates sensor/climate snapshots and tests to use the new fixture and reflect Anna P1 behavior. Changes
Sequence Diagram(s)(omitted — changes are metadata, test data, and snapshot updates; no new runtime control-flow to diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/components/plugwise/snapshots/test_sensor.ambr (1)
5543-5710: Net electricity and voltage snapshots LGTM; tiny precision nit
- Net cumulative (kWh) as total and point (W) as measurement look right.
- Voltage uses suggested_display_precision: 0 but states include decimals (e.g., 234.6). If intended, fine; otherwise consider precision 1 for UI consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
CHANGELOG.md(1 hunks)README.md(1 hunks)custom_components/plugwise/manifest.json(1 hunks)pyproject.toml(1 hunks)tests/components/plugwise/snapshots/test_sensor.ambr(1 hunks)tests/components/plugwise/test_sensor.py(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- README.md
- CHANGELOG.md
- pyproject.toml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 793
File: custom_components/plugwise/manifest.json:10-11
Timestamp: 2024-12-12T19:48:34.652Z
Learning: In the Plugwise integration, temporary use of alpha versions from test repositories is acceptable for testing purposes.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-10-08T15:35:25.180Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-09-27T09:48:30.890Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 906
File: tests/components/plugwise/test_binary_sensor.py:9-16
Timestamp: 2025-08-23T16:26:34.700Z
Learning: The Plugwise integration test files import utilities like `snapshot_platform`, `MockConfigEntry`, and `async_fire_time_changed` from `tests.common`, which is from the Home Assistant core repository at https://github.com/home-assistant/core/blob/master/tests/common.py, not from local test files.
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-10-08T15:35:25.180Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Applied to files:
custom_components/plugwise/manifest.json
📚 Learning: 2025-08-23T16:26:34.700Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 906
File: tests/components/plugwise/test_binary_sensor.py:9-16
Timestamp: 2025-08-23T16:26:34.700Z
Learning: The Plugwise integration test files import utilities like `snapshot_platform`, `MockConfigEntry`, and `async_fire_time_changed` from `tests.common`, which is from the Home Assistant core repository at https://github.com/home-assistant/core/blob/master/tests/common.py, not from local test files.
Applied to files:
custom_components/plugwise/manifest.jsontests/components/plugwise/test_sensor.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_sensor.py (1)
tests/components/plugwise/conftest.py (2)
mock_smile_anna_2(267-291)setup_platform(135-147)
🔇 Additional comments (7)
custom_components/plugwise/manifest.json (1)
10-11: LGTM! Version bumps align with Anna P1 support.The dependency bump to plugwise 1.9.0 and the integration version increment to 0.60.0 are consistent with the PR objectives to add Anna P1 support.
tests/components/plugwise/test_sensor.py (1)
98-108: LGTM! Clean test implementation for Anna P1 sensor snapshot.The new test follows the established snapshot testing pattern and appropriately uses the
mock_smile_anna_2fixture to test Anna P1 sensor functionality. The test structure is consistent with other snapshot tests in the file.tests/components/plugwise/snapshots/test_sensor.ambr (5)
4266-4430: Anna P1 base sensors look correctIlluminance, setpoint, and temperature snapshots align on device_class, state_class, and units; names and unique_ids are consistent. Nice addition.
4431-4650: Verify OT water pressure fixture value (6.0 bar)6.0 bar seems high for typical hydronic loops. If intentional to stress ranges, all good; otherwise consider a realistic value to avoid future confusion.
5435-5541: Gas sensors: confirm state_class choiceGas cumulative is marked total (m³) and interval is measurement (m³/h). Many integrations use total_increasing for cumulative meters; if your source can reset or isn’t strictly monotonic, total is fine. Just confirm this matches Plugwise behavior.
5711-5766: Outdoor temperature for Smile Anna P1Entity/state snapshots are consistent with other temperature sensors. No issues.
4651-5434: Snapshots confirmed as correct and completeThe verification confirms that:
- Test
test_anna_p1_sensor_snapshotexists at line 100 oftests/components/plugwise/test_sensor.py- Uses the
mock_smile_anna_2fixture as expected- The snapshot entries (lines 4651-5434) are properly structured with consistent sensor configurations, translation keys, and units across all P1 electricity sensor variants
All marked sensor behaviors are correct:
- Cumulative sensors use
total_increasingstate class with kWh units- Interval sensors use
totalstate class with Wh units- Point sensors use
measurementstate class with W units



Bump plugwise to v1.9.0, replace climate testcase using the anna_p1 test-fixture
Summary by CodeRabbit
New Features
Chores
Tests
Documentation