Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Nov 9, 2025

Summary by CodeRabbit

  • New Features

    • Added a Zone Profile selector for climate zones to choose Active / Off / Passive.
  • Localization

    • Added English and Dutch translations for the new Zone Profile selector and adjusted select labels for consistency.
  • Tests

    • Added tests covering the new Zone Profile selector and its behavior.
  • Chores

    • Updated integration requirement to the newer Plugwise library version.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds a zone-profile select to the Plugwise Adam integration: new constants and select descriptor, manifest bump, localization key renames and new zone_profile translations, updated test fixtures and snapshots, and a new test verifying select.set_option for zone profiles.

Changes

Cohort / File(s) Summary
Core constants & select descriptor
custom_components/plugwise/const.py, custom_components/plugwise/select.py
Add ZONE_PROFILES and SELECT_ZONE_PROFILE; include select_zone_profile in select type/options and add PlugwiseSelectEntityDescription for zone profiles; update translation_key references and remove obsolete DHW/GATEWAY/REGULATION constants.
Localization / UI strings
custom_components/plugwise/strings.json, custom_components/plugwise/translations/en.json, custom_components/plugwise/translations/nl.json
Rename select keys to select_* form (dhw_mode, regulation_mode, gateway_mode → select_dhw_mode, select_regulation_mode, select_gateway_mode) and add select_zone_profile with states active, off, passive (EN/NL).
Manifest & changelog
custom_components/plugwise/manifest.json, CHANGELOG.md
Bump plugwise requirement to plugwise==1.10.0; add changelog entry describing Adam zone profile feature.
Test fixtures
tests/components/plugwise/fixtures/.../data.json (multiple files)
Add select_zone_profile values and zone_profiles arrays ["active","off","passive"] to relevant zone entries across fixtures.
Tests & snapshots
tests/components/plugwise/snapshots/test_select.ambr, tests/components/plugwise/test_init.py, tests/components/plugwise/test_select.py
Add snapshot entries/states for select.*_zone_profile; update expected entity/device registry counts (+2); add test_adam_select_zone_profile asserting underlying set_select call parameters.

Sequence Diagram(s)

sequenceDiagram
    participant User as HomeAssistant UI / Automation
    participant HA as HA Core (select service)
    participant Int as plugwise integration
    participant Lib as plugwise library/device

    Note over User,HA: User triggers select.set_option (zone profile)
    User->>HA: call service select.set_option(entity_id, option)
    HA->>Int: dispatch select change request
    Int->>Lib: set_select(key: "select_zone_profile", zone_hash, option)
    alt success
        Lib-->>Int: ack
        Int-->>HA: update entity state
        HA-->>User: new state (e.g., "passive")
    else failure
        Lib-->>Int: error
        Int-->>HA: report failure
        HA-->>User: error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check translation key renames in all locale files and strings.json for consistency and missing references.
  • Verify manifest version bump and any upstream compatibility implications.
  • Review added tests/snapshots to ensure registry count updates and expected set_select call parameters match library API.

Possibly related PRs

Suggested labels

enhancement, needs_upstreaming

Suggested reviewers

  • CoMPaTech

Poem

🐰 I hopped through constants, strings, and test,
A zone profile added — neatly dressed,
Active, passive, or off to choose,
Fixtures, snapshots, and a test to use,
I nibble code and celebrate the rest!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title 'New feature: implement setting Adam zone profile' directly and clearly describes the main change: adding the ability to set Adam zone profiles, which is reflected across all modified files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zone_profile

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 and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 9, 2025

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 303822a and 2650853.

📒 Files selected for processing (1)
  • custom_components/plugwise/manifest.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 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.json
📚 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:

  • custom_components/plugwise/manifest.json
⏰ 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). (2)
  • GitHub Check: Setup for HA-core (dev)
  • GitHub Check: Setup for HA-core (release/master)

@bouwew bouwew marked this pull request as ready for review November 9, 2025 16:49
@bouwew bouwew requested a review from a team as a code owner November 9, 2025 16:49
@bouwew bouwew requested a review from CoMPaTech November 9, 2025 16:50
@bouwew bouwew changed the title New feature: implement setting of Adam zone profile New feature: implement setting Adam zone profile Nov 9, 2025
@bouwew bouwew merged commit 9a9736d into main Nov 9, 2025
13 checks passed
@bouwew bouwew deleted the zone_profile branch November 9, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants