-
Notifications
You must be signed in to change notification settings - Fork 7
Revert exception-changes, line up with Core Plugwise, missed snapshot-update #990
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
WalkthroughRefactors Plugwise coordinator to defer connect until needed and centralize error mappings; updates tests to use config-entry setup flow; renames/remaps translation keys (invalid_xml_data → invalid_setup; adds response_error); updates snapshots entity_category; bumps version and adds changelog note. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant H as Home Assistant
participant CE as ConfigEntry
participant C as PlugwiseCoordinator
participant P as Plugwise Library / Device
Note right of C: lazy connect — connect deferred until update
H->>CE: add_to_hass(entry)
H->>CE: async_setup(entry_id)
CE->>C: instantiate coordinator
H->>C: trigger update cycle
alt not connected
C->>P: connect()
P-->>C: version/info or raises error
end
alt connection success
C->>P: fetch_data()
P-->>C: data
C->>H: return data (entities updated)
else connection error
P-->>C: raises specific error
C->>H: map error → UpdateFailed or ConfigEntryError (invalid_setup / response_error / unsupported_firmware)
H->>CE: set ConfigEntryState (SETUP_RETRY / SETUP_ERROR)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2024-10-08T15:35:25.180ZApplied to files:
📚 Learning: 2024-09-30T18:06:35.677ZApplied to files:
⏰ 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)
🔇 Additional comments (2)
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/components/plugwise/test_init.py(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (1)
mock_config_entry(81-95)
🪛 Ruff (0.14.8)
tests/components/plugwise/test_init.py
139-142: pytest.raises() block should contain a single simple statement
(PT012)
⏰ 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
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
7f6128a to
66bf4c3
Compare
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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: 1
🧹 Nitpick comments (1)
tests/components/plugwise/test_init.py (1)
29-33: Remove commented-out imports instead of leaving dead code.If
ConfigEntryErrorandUpdateFailedare no longer needed, delete these lines entirely. Commented-out code clutters the codebase and creates confusion about whether it's intentionally disabled or accidentally left behind.- -# from homeassistant.exceptions import ConfigEntryError from homeassistant.helpers import device_registry as dr, entity_registry as er - -# from homeassistant.helpers.update_coordinator import UpdateFailed
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/components/plugwise/test_init.py(2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (2)
mock_config_entry(81-95)mock_smile_anna(240-263)
⏰ 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 (release/master)
- GitHub Check: Setup for HA-core (dev)
🔇 Additional comments (1)
tests/components/plugwise/test_init.py (1)
119-143: LGTM!The test correctly validates transient connection errors by using the config-entry setup flow and asserting
SETUP_RETRYstate. The separation of transient errors (ConnectionFailedError, InvalidXMLError, ResponseError) from fatal errors is appropriate.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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/test_init.py (1)
30-32: Remove the commented-out import.The commented-out
UpdateFailedimport is dead code. Remove it entirely rather than leaving it commented.- -# from homeassistant.helpers.update_coordinator import UpdateFailed from homeassistant.setup import async_setup_component
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/components/plugwise/snapshots/test_select.ambr(6 hunks)tests/components/plugwise/test_init.py(2 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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`.
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
tests/components/plugwise/test_init.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (2)
mock_config_entry(81-95)mock_smile_anna(240-263)
⏰ 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)
🔇 Additional comments (3)
tests/components/plugwise/snapshots/test_select.ambr (1)
144-144: Verify the intentional removal ofentity_category: CONFIGfor thermostat schedule entities.All thermostat schedule select entities (
bathroom_thermostat_schedule,living_room_thermostat_schedule,badkamer_thermostat_schedule,bios_thermostat_schedule,jessie_thermostat_schedule,woonkamer_thermostat_schedule) now haveentity_category: Noneinstead ofEntityCategory.CONFIG.This changes their visibility in the Home Assistant UI—they will now appear in the main entity list rather than being hidden under "configuration entities." Please confirm this is the intended behavioral change.
Also applies to: 266-266, 389-389, 454-454, 519-519, 584-584
tests/components/plugwise/test_init.py (2)
119-130: Well-structured parametrization for exception handling.The mapping of exceptions to expected
ConfigEntryStateoutcomes correctly distinguishes between fatal errors (SETUP_ERROR) and transient errors (SETUP_RETRY). This addresses the previous review feedback and provides clear, maintainable test coverage for the coordinator's exception translation logic.
131-146: LGTM!The test now properly exercises the full config-entry setup flow rather than directly calling internal coordinator methods. This approach is more robust and tests the actual integration behavior users would experience.
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/test_init.py (1)
129-144: Update the docstring to reflect the new test approach.The test logic correctly verifies that exceptions from
connect()are translated into appropriate ConfigEntryState values via the config-entry setup flow. However, the docstring states "Ensure _connect raises translated errors," which no longer accurately describes the test since it doesn't directly call_connect().Update the docstring to something like:
- """Ensure _connect raises translated errors.""" + """Verify that connect exceptions are translated to appropriate config entry states."""
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/components/plugwise/test_init.py(1 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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`.
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
tests/components/plugwise/test_init.py
⏰ 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)
🔇 Additional comments (1)
tests/components/plugwise/test_init.py (1)
118-127: LGTM!The parametrization correctly maps each exception type to its appropriate ConfigEntryState. Fatal errors (authentication, setup, unsupported device) result in SETUP_ERROR, while transient errors (connection, XML, response) result in SETUP_RETRY, allowing for automatic retry logic.
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/test_init.py (1)
129-144: Update the docstring to reflect the new test approach.The test implementation is correct and properly uses the config-entry setup flow. However, the docstring at line 136 states "Ensure _connect raises translated errors," which no longer accurately describes what the test does. The test now validates that exceptions raised during the connect phase result in the correct config-entry state (SETUP_ERROR or SETUP_RETRY).
Apply this diff to update the docstring:
- """Ensure _connect raises translated errors.""" + """Test that connect exceptions result in the correct config-entry state."""
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/components/plugwise/test_init.py(2 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
📚 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:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
tests/components/plugwise/test_init.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (2)
mock_config_entry(81-95)mock_smile_anna(240-263)
🔇 Additional comments (2)
tests/components/plugwise/test_init.py (2)
104-104: LGTM - Minor docstring improvement.The terminology change from "configuration entry" to "config-entry" improves consistency with the codebase.
118-127: LGTM - Correct exception-to-state mapping.The parametrization correctly maps exceptions to their expected ConfigEntryState values:
- Fatal errors (authentication, setup, unsupported device) → SETUP_ERROR
- Transient errors (connection, XML, response, general) → SETUP_RETRY
This aligns with the coordinator's exception handling logic.
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/test_init.py (1)
117-144: Consider updating the docstring to reflect the new test approach.The test logic correctly verifies that exceptions raised by
connect()result in appropriateConfigEntryStatevalues when exercising the full config-entry setup flow. The parametrization properly maps fatal errors (InvalidAuthentication, InvalidSetupError, UnsupportedDeviceError) toSETUP_ERRORand transient errors (ConnectionFailedError, InvalidXMLError, ResponseError, PlugwiseError) toSETUP_RETRY.However, the docstring on line 136 still references
_connectdirectly, which is no longer accurate since the test now exercises the complete config-entry initialization path.Consider this minor docstring update:
- """Ensure _connect raises translated errors.""" + """Test that connect exceptions result in appropriate config entry states."""
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/components/plugwise/test_init.py(2 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
tests/components/plugwise/test_init.py
📚 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:
tests/components/plugwise/test_init.py
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
tests/components/plugwise/test_init.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_init.py (1)
tests/components/plugwise/conftest.py (2)
mock_config_entry(81-95)mock_smile_anna(240-263)
⏰ 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)
🔇 Additional comments (1)
tests/components/plugwise/test_init.py (1)
104-104: LGTM: consistent terminology.The docstring now uses "config-entry" which aligns with Home Assistant's standard terminology.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
custom_components/plugwise/coordinator.py(3 hunks)custom_components/plugwise/strings.json(1 hunks)custom_components/plugwise/translations/en.json(1 hunks)custom_components/plugwise/translations/nl.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 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: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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.
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.
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`.
📚 Learning: 2025-12-03T10:16:54.887Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 982
File: custom_components/plugwise/coordinator.py:120-132
Timestamp: 2025-12-03T10:16:54.887Z
Learning: In Home Assistant integrations, when a coordinator extends DataUpdateCoordinator and defines an `_async_setup()` method, it is automatically called by the framework during `async_config_entry_first_refresh()` before the first data update. The framework calls `__wrap_async_setup()` which invokes `_async_setup()`, so there's no need to manually call it during coordinator initialization.
Applied to files:
custom_components/plugwise/coordinator.py
⏰ 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 (release/master)
- GitHub Check: Setup for HA-core (dev)
🔇 Additional comments (6)
custom_components/plugwise/translations/en.json (1)
309-311: LGTM!The key rename from
invalid_xml_datatoresponse_erroris consistent with the coordinator's updated exception handling and aligns with the parallel changes instrings.jsonandnl.json.custom_components/plugwise/translations/nl.json (1)
324-326: LGTM!The Dutch translation is consistent with the English version and the key rename aligns with the coordinator changes.
custom_components/plugwise/strings.json (1)
326-328: LGTM!The key rename and message update are consistent with the coordinator's exception handling changes.
custom_components/plugwise/coordinator.py (3)
85-101: Clean simplification of_connect.Removing the per-exception try/except blocks in favor of handling errors in
_async_update_datais a good refactor. Deriving_connectedfrom theVersionobject type is appropriate.
116-126: Lazy connection pattern looks good.The deferred connection within
_async_update_datais clean, and theConnectionFailedErrorhandler appropriately raisesUpdateFailedto allow retries on subsequent polling cycles.
142-151: The current exception handling order is correct. The test suite confirms thatUnsupportedDeviceErrorproducesConfigEntryState.SETUP_ERRORwith the "unsupported_firmware" message, not thePlugwiseErrorfallback behavior. This indicatesUnsupportedDeviceErrordoes not inherit fromPlugwiseError, or if it does, the exception handling is working as intended. No changes needed.
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)
custom_components/plugwise/strings.json (1)
326-331: Minor indentation inconsistency, but content is correct.The exception keys are properly added with clear messages matching the translations file. However, line 327 uses 8 spaces of indentation while the rest of the file (including line 330) uses 6 spaces for message values.
Apply this diff to align indentation:
"invalid_setup": { - "message": "Add your Adam instead of your Anna, see the documentation" + "message": "Add your Adam instead of your Anna, see the documentation" },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
custom_components/plugwise/strings.json(1 hunks)custom_components/plugwise/translations/en.json(1 hunks)custom_components/plugwise/translations/nl.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- custom_components/plugwise/translations/nl.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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: 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.
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.
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`.
📚 Learning: 2024-06-22T08:05:56.791Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
custom_components/plugwise/translations/en.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 (release/master)
- GitHub Check: Setup for HA-core (dev)
🔇 Additional comments (1)
custom_components/plugwise/translations/en.json (1)
309-313: LGTM! Exception keys added correctly.The
invalid_setupandresponse_errorexception keys are properly structured and provide clear, actionable messages. Note thatresponse_errorhas a more detailed message here ("...from the Plugwise Adam/Smile/Stretch") compared to theconfig.error.response_erroron line 15, which may be intentional to provide more context for runtime exceptions versus setup errors.
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
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.mdcustom_components/plugwise/strings.jsoncustom_components/plugwise/translations/nl.json
🚧 Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
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: 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.
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/select.py:86-87
Timestamp: 2024-10-08T15:35:25.180Z
Learning: Ignore suggestions related to exception handling in device retrieval for the pw-beta branch as per user's request.
📚 Learning: 2024-10-08T15:35:25.180Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Applied to files:
custom_components/plugwise/translations/nl.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). (1)
- GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (2)
custom_components/plugwise/translations/nl.json (1)
324-326: LGTM: Translation key renamed appropriately.The
invalid_setupkey and its Dutch translation are clear and consistent with the same key in theconfig.errorsection (line 42).custom_components/plugwise/strings.json (1)
326-328: LGTM: Translation key renamed appropriately.The
invalid_setupkey and message are clear and consistent with the same key in theconfig.errorsection (line 42).
|



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