Conversation
📝 WalkthroughWalkthroughThis PR bumps the Plugwise integration to v0.63.1, introduces direct API access in climate entities via a dedicated Changes
Sequence DiagramsequenceDiagram
participant User as Climate Entity
participant API as Plugwise API
participant Schedule as Schedule Manager
participant Regulation as Regulation Manager
User->>API: set_hvac_mode(mode)
alt Mode is OFF
API->>Regulation: set_regulation_mode(OFF)
Regulation-->>API: confirmed
else Mode is HEAT/COOL/HEAT_COOL
alt Schedule exists
API->>Schedule: set_schedule_state(enabled=true)
Schedule-->>API: confirmed
API->>Regulation: set_regulation_mode(manual_mode)
Regulation-->>API: confirmed
else No schedule
API->>Regulation: set_regulation_mode(manual_mode)
Regulation-->>API: confirmed
end
else Mode is AUTO
alt Last active schedule available
API->>Schedule: set_schedule_state(last_active_schedule)
Schedule-->>API: confirmed
API->>Regulation: set_regulation_mode(AUTO)
Regulation-->>API: confirmed
else No schedule available
API->>User: error_no_schedule
end
end
API-->>User: mode_set_complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@custom_components/plugwise/translations/en.json`:
- Around line 1-347: The JSON file's keys are not sorted/formatted per the
project's Prettier/JSON sorting CI rule (affecting top-level keys like "config",
"entity", "exceptions", "options", "services" and nested keys such as
"config.abort", "entity.sensor", etc.); re-run the project's formatter (Prettier
or the repository's JSON sorting tool) on this file (and any other JSON you
modified), stage the updated sorted/formatted JSON, and commit that change so CI
no longer reports sorting differences.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
CHANGELOG.mdcustom_components/plugwise/climate.pycustom_components/plugwise/manifest.jsoncustom_components/plugwise/translations/en.jsonpyproject.tomltests/components/plugwise/test_climate.py
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@custom_components/plugwise/climate.py`:
- Around line 306-347: When handling HVACMode.OFF in set_hvac_mode, first
disable any active schedule before calling self._api.set_regulation_mode to
avoid the schedule re-enabling and overriding the OFF state on next refresh;
specifically, read the current schedule from self.device.get("select_schedule"),
store it to self._last_active_schedule if it isn’t already "off", call the API
to set the schedule to "off" (or use the existing schedule API call) and only
then call self._api.set_regulation_mode(hvac_mode.value); follow the same
pattern used by _set_manual_hvac_mode and _set_auto_hvac_mode to ensure
_last_active_schedule is preserved and schedules are turned off before setting
regulation to OFF.



Summary by CodeRabbit
New Features
Version