Skip to content

Add missing response-types#422

Merged
bouwew merged 4 commits intomainfrom
more-acks
Mar 8, 2026
Merged

Add missing response-types#422
bouwew merged 4 commits intomainfrom
more-acks

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Mar 8, 2026

Summary by CodeRabbit

  • Chores
    • Updated internal message handling with new response type definitions to enhance device communication reliability and system compatibility. Added support for command validation, network operations, device configuration management, status reporting, and acknowledgment handling for improved device interaction and protocol robustness.

@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@bouwew has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f794018-32da-45c5-9543-8fa2bbce1209

📥 Commits

Reviewing files that changed from the base of the PR and between 65c8bd4 and ba37c71.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • plugwise_usb/messages/responses.py
📝 Walkthrough

Walkthrough

The PR adds missing response type codes to the Plugwise USB library. New enum members are introduced to StickResponseType, NodeResponseType, and NodeAckResponseType in responses.py, with a corresponding CHANGELOG entry for version 0.47.4.

Changes

Cohort / File(s) Summary
Version Update
CHANGELOG.md
Added v0.47.4 release entry dated 2026-03-08 documenting the addition of missing response-types (PR 422).
Response Type Enums
plugwise_usb/messages/responses.py
Expanded StickResponseType with COMMAND_NOT_ALLOWED, CANNOT_JOIN_NETWORK, NODE_CHANGE_ACCEPTED, PING_TIMEOUT_1SEC, PUBLIC_NETWORK_INFO_COMPLETE. Extended NodeResponseType with POWER_CALIBRATION_ACCEPTED, NODE_RESET_FAIL, POWER_LOG_INTERVAL_ACCEPTED, REAL_TIME_CLOCK_ACCEPTED/FAILED, RELAY_SWITCHED_OFF/ON/FAILED, SED_CONFIG_ACCEPTED/FAILED. Updated NodeAckResponseType with DEFAULT_ACK, DEFAULT_FAIL. All additions include descriptive inline comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • dirixmjm
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add missing response-types' directly and accurately describes the main change: adding missing response type codes to the response enums in plugwise_usb/messages/responses.py.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-acks

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.

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.08%. Comparing base (52a6613) to head (ba37c71).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #422      +/-   ##
==========================================
+ Coverage   82.06%   82.08%   +0.01%     
==========================================
  Files          36       36              
  Lines        8181     8189       +8     
==========================================
+ Hits         6714     6722       +8     
  Misses       1467     1467              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugwise_usb/messages/responses.py`:
- Around line 83-91: NodeAckResponseType introduced DEFAULT_ACK and DEFAULT_FAIL
but consumers still treat non-SCAN_CONFIG_* values as unexpected; update the
code that interprets ack results (e.g., the handler in
plugwise_usb/nodes/scan.py that checks NodeAckResponseType around the scan
config ack logic) to treat DEFAULT_ACK as equivalent to SCAN_CONFIG_ACCEPTED and
DEFAULT_FAIL as equivalent to SCAN_CONFIG_FAILED (or otherwise branch validly
for DEFAULT_*), and audit other uses of NodeAckResponseType to ensure
DEFAULT_ACK/DEFAULT_FAIL are handled consistently instead of being treated as
failures/unexpected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1d0f893-767b-4cea-b225-678684f065d9

📥 Commits

Reviewing files that changed from the base of the PR and between c9d71e2 and 65c8bd4.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • plugwise_usb/messages/responses.py

Comment on lines +83 to +91
DEFAULT_ACK= b"00A0"
DEFAULT_FAIL = b"00A1"
SCAN_CONFIG_ACCEPTED = b"00BE" # HN_ACKSETSCANPARAMS_ACK
SCAN_CONFIG_FAILED = b"00BF" # HN_ACKSETSCANPARAMS_NACK
SCAN_LIGHT_CALIBRATION_ACCEPTED = b"00BD"
SENSE_INTERVAL_ACCEPTED = b"00B3"
SENSE_INTERVAL_FAILED = b"00B4"
SENSE_BOUNDARIES_ACCEPTED = b"00B5"
SENSE_BOUNDARIES_FAILED = b"00B6"
SENSE_INTERVAL_ACCEPTED = b"00B3" # HN_ACKSETSENSEINTERVAL_ACK
SENSE_INTERVAL_FAILED = b"00B4" # HN_ACKSETSENSEINTERVAL_NACK
SENSE_BOUNDARIES_ACCEPTED = b"00B5" # HN_ACKSETSENSEBOUNDARIES_ACK
SENSE_BOUNDARIES_FAILED = b"00B6" # HN_ACKSETSENSEBOUNDARIES_NACK
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update the NodeAckResponseType consumers with these new default codes.

DEFAULT_ACK / DEFAULT_FAIL only fix enum parsing here. At minimum, plugwise_usb/nodes/scan.py Lines 452-465 still treats any NodeAckResponseType outside SCAN_CONFIG_* as unexpected and returns False, so a successful DEFAULT_ACK would still be surfaced as a failed scan configuration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugwise_usb/messages/responses.py` around lines 83 - 91, NodeAckResponseType
introduced DEFAULT_ACK and DEFAULT_FAIL but consumers still treat
non-SCAN_CONFIG_* values as unexpected; update the code that interprets ack
results (e.g., the handler in plugwise_usb/nodes/scan.py that checks
NodeAckResponseType around the scan config ack logic) to treat DEFAULT_ACK as
equivalent to SCAN_CONFIG_ACCEPTED and DEFAULT_FAIL as equivalent to
SCAN_CONFIG_FAILED (or otherwise branch validly for DEFAULT_*), and audit other
uses of NodeAckResponseType to ensure DEFAULT_ACK/DEFAULT_FAIL are handled
consistently instead of being treated as failures/unexpected.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

@bouwew bouwew marked this pull request as ready for review March 8, 2026 09:28
@bouwew bouwew requested a review from a team as a code owner March 8, 2026 09:28
@bouwew bouwew merged commit 6344875 into main Mar 8, 2026
16 of 17 checks passed
@bouwew bouwew deleted the more-acks branch March 8, 2026 09:29
@coderabbitai coderabbitai bot mentioned this pull request Mar 9, 2026
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.

1 participant