-
Notifications
You must be signed in to change notification settings - Fork 8
Extend feature: extent/improve Plugwise groups #976
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
WalkthroughThe Plugwise integration is updated to require plugwise v1.11.0 instead of v1.10.0. Test fixtures for multiple Adam/Emma device configurations are updated to reflect new group entity types with electricity and temperature sensors. Test assertions and snapshots are updated accordingly. Changes
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)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
🚧 Files skipped from review as they are similar to previous changes (8)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
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: 2
🧹 Nitpick comments (1)
tests/components/plugwise/snapshots/test_sensor.ambr (1)
1219-1329: New group‑level electricity/temperature and illuminance sensors match the extended group modelThe added snapshots for
sensor.test_electricity_*,sensor.vloerverwarming_*, and the new Anna illuminance sensors use:
- unique_ids derived from the corresponding group/device IDs seen in diagnostics,
- appropriate
device_class,state_class, and units (W/kWh/°C/lx),- translation_keys consistent with existing single‑device sensors.
This looks correct for the new group feature. If you ever decide these group totals should be treated as diagnostics rather than primary sensors, you could optionally set their
entity_categoryto DIAGNOSTIC as well, but it’s reasonable as‑is.Also applies to: 1604-1771, 1772-1807
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
CHANGELOG.md(1 hunks)custom_components/plugwise/manifest.json(1 hunks)tests/components/plugwise/fixtures/adam_plus_anna_new/data.json(2 hunks)tests/components/plugwise/fixtures/m_adam_cooling/data.json(2 hunks)tests/components/plugwise/fixtures/m_adam_heating/data.json(2 hunks)tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json(2 hunks)tests/components/plugwise/fixtures/stretch_v31/data.json(2 hunks)tests/components/plugwise/snapshots/test_binary_sensor.ambr(7 hunks)tests/components/plugwise/snapshots/test_diagnostics.ambr(2 hunks)tests/components/plugwise/snapshots/test_sensor.ambr(19 hunks)tests/components/plugwise/test_init.py(3 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 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: 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: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Applied to files:
tests/components/plugwise/fixtures/stretch_v31/data.jsonCHANGELOG.md
📚 Learning: 2024-12-12T19:48:34.652Z
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.
Applied to files:
CHANGELOG.md
📚 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.jsontests/components/plugwise/test_init.py
📚 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.json
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (1)
mock_config_entry(81-95)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md
7-7: No empty links
(MD042, no-empty-links)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (9)
tests/components/plugwise/fixtures/stretch_v31/data.json (1)
88-116: Verify sensor block consistency across group fixtures.The group model is renamed from "Switchgroup" to "Group" correctly. However, note that other fixtures in this PR (e.g., m_adam_heating, m_adam_cooling) add
sensorsblocks to their Group entries, while this fixture does not. Confirm whether this is intentional or whether sensor blocks should be added here as well.tests/components/plugwise/fixtures/adam_plus_anna_new/data.json (1)
184-198: Group fixture updates are well-structured.The new Group entry is properly formed with valid member references and consistent sensor aggregations. The existing entry is correctly updated with model rename and sensor block addition. The data integrity and structure look good.
Also applies to: 275-280
tests/components/plugwise/fixtures/m_adam_cooling/data.json (1)
94-108: Group fixture updates maintain consistency.The new and updated Group entries are properly formed. Sensor values reflect the cooling scenario context, and the reuse of group ID c9293d1d68ee48fc8843c6f0dee2b6be across fixtures is consistent with the overall design.
Also applies to: 191-195
tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json (1)
508-521: Group fixture updates are consistent with multi-device-per-zone scenario.The new Group entry correctly aggregates member devices (CV pump and zone sensor). Note that
electricity_producedis omitted from the new group's sensors; verify this is intentional based on the device capabilities.Also applies to: 556-561
tests/components/plugwise/fixtures/m_adam_heating/data.json (1)
99-113: Group fixture updates are consistent with heating scenario.The new and updated Group entries follow the established pattern. Sensor aggregations are consistent with the fixture's heating context.
Also applies to: 190-195
tests/components/plugwise/test_init.py (1)
300-300: Incorrect entity count delta in review comment.The review comment states entity registry increases by "+5 entries" per state, but the test expectations show a delta of +7 entities (63 − 56 = 7). The new Tom/Floor device adds 1 device + 6 entities (1 binary_sensor + 5 sensors), totaling 7 new entities. The device count delta of "+1" is correct. Correct the entity delta from "+5" to "+7" in the verification statement.
Likely an incorrect or invalid review comment.
tests/components/plugwise/snapshots/test_binary_sensor.ambr (1)
14-15: Binary sensors reclassified as DIAGNOSTIC are consistent and appropriateThe updated
entity_category = EntityCategory.DIAGNOSTICfor notification and heating/heatpump state binary_sensors matches their diagnostic nature and aligns with the broader PR changes; the snapshots remain internally consistent.Also applies to: 163-165, 553-555, 649-651, 745-747, 841-843, 889-891
tests/components/plugwise/snapshots/test_diagnostics.ambr (1)
557-570: New/extended diagnostics group entries look structurally soundThe added pumping group (
e117db...) and updated switching group (e8ef2a...nowmodel: 'Group'with electricity sensors) correctly mirror the existing diagnostics schema: member IDs are valid, sensor keys/units match other devices, and values are plausible. This matches the extended group feature described in the PR.Also applies to: 599-615
tests/components/plugwise/snapshots/test_sensor.ambr (1)
16-17: Diagnostic entity_category assignments for sensors are coherentMarking internal/battery/boiler/OpenTherm/outdoor and similar technical metrics as
EntityCategory.DIAGNOSTICwhile leaving main consumption and climate readings uncategorized is consistent and keeps primary dashboards focused on user‑relevant data; the snapshots remain self‑consistent.Also applies to: 352-353, 570-571, 788-789, 1121-1122, 1177-1178, 1331-1346, 1565-1567, 1785-1787, 1951-1952, 2115-2116, 3231-3232, 3399-3400, 3508-3509, 3564-3565, 3669-3673, 3728-3730, 3784-3785, 3840-3841, 3896-3898
|



Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.