-
Notifications
You must be signed in to change notification settings - Fork 2
Let PlugwiseCirclePlus class load NodeFeature.CIRCLE too #274
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
This makes the reset energy collection function available to the + devices
WalkthroughThe changes introduce a new constant for the Circle Plus node features including Changes
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Pylint (3.3.7)plugwise_usb/nodes/circle_plus.py📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ 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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #274 +/- ##
=======================================
Coverage 80.79% 80.80%
=======================================
Files 36 36
Lines 7588 7589 +1
=======================================
+ Hits 6131 6132 +1
Misses 1457 1457 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 (2)
pyproject.toml (1)
7-7: Bump version to reflect pre-release
The project version has been updated to0.44.5a0to capture this new feature rollout. Consider adding or updating a changelog entry so users know that Circle reset energy collection is now available on “+” devices.plugwise_usb/nodes/circle_plus.py (1)
34-44: Add CIRCLE feature in cache-load path
You've correctly insertedNodeFeature.CIRCLEinto the_setup_protocolcall when loading from cache. To avoid this list diverging in the future, you may want to extract it into a single constant.Proposed diff:
+FEATURES_CIRCLE_PLUS = ( + NodeFeature.RELAY, + NodeFeature.RELAY_INIT, + NodeFeature.RELAY_LOCK, + NodeFeature.ENERGY, + NodeFeature.POWER, + NodeFeature.CIRCLE, + NodeFeature.CIRCLEPLUS, +) _setup_protocol( CIRCLE_PLUS_FIRMWARE_SUPPORT, - ( - NodeFeature.RELAY, - NodeFeature.RELAY_INIT, - NodeFeature.RELAY_LOCK, - NodeFeature.ENERGY, - NodeFeature.POWER, - NodeFeature.CIRCLE, - NodeFeature.CIRCLEPLUS, - ), + FEATURES_CIRCLE_PLUS, )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
plugwise_usb/nodes/circle_plus.py(2 hunks)pyproject.toml(1 hunks)tests/test_usb.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Process test coverage
🔇 Additional comments (2)
plugwise_usb/nodes/circle_plus.py (1)
72-82: ```shell
#!/bin/bashCheck for node classes using NodeFeature without CIRCLE
for f in plugwise_usb/nodes/*.py; do
if grep -q "NodeFeature." "$f"; then
if ! grep -q "NodeFeature.CIRCLE" "$f"; then
echo "$f missing NodeFeature.CIRCLE"
fi
fi
done</details> <details> <summary>tests/test_usb.py (1)</summary> `2486-2488`: **Include CIRCLE feature for Circle+ INFO features** The test now correctly asserts that `NodeFeature.CIRCLE` is included alongside `CIRCLEPLUS` in the INFO feature set for Circle+ nodes, matching the updated support in `PlugwiseCirclePlus`. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
dirixmjm
left a 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.
The circleplus is an extension of a circle (inherited class). Ideally the initalisation calls back tot the super() which setups the circle features, then the circleplus only needs to add the extension to the feature.
|
@dirixmjm do you mind if we postpone such a change to a follow-up PR? |
|
Ok, fair enough |
|



This makes the reset energy collection function available to the + devices
Summary by CodeRabbit