-
Notifications
You must be signed in to change notification settings - Fork 7
Adapt to plugwise v.1.7.6 #878
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
WalkthroughThis update increments the required "plugwise" backend package version from 1.7.4 to 1.7.6, updates the integration version to 0.57.4 in both the manifest and project files, and revises the changelog to reflect these changes and recent release notes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HomeAssistant
participant PlugwiseIntegration
participant PlugwiseBackend
User->>HomeAssistant: Initiates action (e.g., toggle switch)
HomeAssistant->>PlugwiseIntegration: Process user action
PlugwiseIntegration->>PlugwiseBackend: Uses plugwise v1.7.6 API
PlugwiseBackend-->>PlugwiseIntegration: Returns response (no error on locked switch)
PlugwiseIntegration-->>HomeAssistant: Update state
HomeAssistant-->>User: Reflect result
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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:
❌ Error: Incompatible while testing against released HA-core and required to pass.
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: 3
♻️ Duplicate comments (1)
custom_components/plugwise/switch.py (1)
143-148: Same instant-feedback issue forasync_turn_offMirror the
async_turn_onadjustment to keep behaviour symmetrical.
🧹 Nitpick comments (1)
custom_components/plugwise/switch.py (1)
133-138: Immediate state push missing
plugwise_commandschedules a refresh, but UI feedback is delayed until the coordinator cycle finishes. Callingself.async_write_ha_state()after updating_attr_is_ongives instant feedback.- self._attr_is_on = await self.coordinator.api.set_switch_state( + self._attr_is_on = await self.coordinator.api.set_switch_state( ... ) + self.async_write_ha_state()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
custom_components/plugwise/manifest.json(1 hunks)custom_components/plugwise/switch.py(2 hunks)tests/components/plugwise/test_switch.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
tests/components/plugwise/test_switch.py (1)
tests/components/plugwise/conftest.py (1)
mock_smile_adam(118-146)
custom_components/plugwise/switch.py (2)
custom_components/plugwise/entity.py (1)
device(91-93)custom_components/plugwise/util.py (1)
plugwise_command(21-46)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Setup for HA-core (dev)
- GitHub Check: Setup for HA-core (release/master)
| "requirements": [ | ||
| "https://test-files.pythonhosted.org/packages/36/d7/e9d82d927fbad3edd56c8da59fef08dbf1e80ff535eee1ba6e4eb649ca89/plugwise-1.7.5a1.tar.gz#plugwise==1.7.5a1" | ||
| ], |
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.
🛠️ Refactor suggestion
Direct-URL requirement string is not PEP 508 compliant
The fragment #plugwise==1.7.5a1 will not be recognised by pip; the canonical form is either
"plugwise @ https://…/plugwise-1.7.5a1.tar.gz"
or
"https://…/plugwise-1.7.5a1.tar.gz#egg=plugwise"
An invalid spec will break HA’s runtime dependency install.
Apply:
-"https://test-files.pythonhosted.org/.../plugwise-1.7.5a1.tar.gz#plugwise==1.7.5a1"
+"plugwise @ https://test-files.pythonhosted.org/.../plugwise-1.7.5a1.tar.gz"🤖 Prompt for AI Agents
In custom_components/plugwise/manifest.json at lines 10 to 12, the direct URL
requirement string is not PEP 508 compliant because it uses the fragment
#plugwise==1.7.5a1 which pip does not recognize. To fix this, replace the
current string with a PEP 508 compliant format such as "plugwise @
https://.../plugwise-1.7.5a1.tar.gz" or
"https://.../plugwise-1.7.5a1.tar.gz#egg=plugwise" to ensure proper dependency
installation by Home Assistant.
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:
❌ Error: Incompatible while testing against released HA-core and required to pass.
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:
❌ Error: Incompatible while testing against released HA-core and required to pass.
|



Via this update,
set_switch_state()in plugwise doesn't raise an error when a locked switch is toggled.This corrects the behavior in the frontend: when a locked switch is toggled it will return to it's previous state after a few seconds.
At present, the switch toggles to the opposite state when clicked and stays in that state, which is wrong. Only after a browser-refresh the correct switch state is shown.
Summary by CodeRabbit
Bug Fixes
Tests
Chores