Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Sep 24, 2025

Summary by CodeRabbit

  • Refactor

    • Adjusted node registration flow: newly added devices are no longer auto-listed immediately upon add; appearance now depends on subsequent discovery. This may affect the timing of when new devices show up after registration.
  • Documentation

    • Updated the ongoing changelog to split and note recent pull requests, including adding a new entry and clarifying an existing one.

@coderabbitai
Copy link

coderabbitai bot commented Sep 24, 2025

Walkthrough

Decouples node registration from registry updates and discovery callbacks in register_node. The function now only sends NodeAddRequest and handles errors. Updates CHANGELOG Ongoing section by splitting an entry into separate bullets for PRs 344 and 348.

Changes

Cohort / File(s) Summary
Registry behavior change
plugwise_usb/network/registry.py
Removed automatic MAC insertion into internal registry and the immediate discovery callback trigger after successful NodeAddRequest. register_node now only performs the request and error handling.
Changelog update
CHANGELOG.md
Adjusted Ongoing section: split existing PR 344 note and added a new entry for PR 348.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Registry
  participant Plugwise as PlugwiseNetwork

  rect rgb(240,248,255)
    note right of Caller: Previous flow (before)
    Caller->>Registry: register_node(mac)
    Registry->>Plugwise: NodeAddRequest(mac)
    Plugwise-->>Registry: Success/Failure
    alt Success
      Registry->>Registry: Add mac to _registry
      Registry->>Caller: _exec_node_discover_callback(mac)
    else Failure
      Registry-->>Caller: Error/exception
    end
  end

  rect rgb(245,255,245)
    note right of Caller: New flow (now)
    Caller->>Registry: register_node(mac)
    Registry->>Plugwise: NodeAddRequest(mac)
    Plugwise-->>Registry: Success/Failure
    alt Success
      note over Registry: No registry update<br/>No discovery callback
      Registry-->>Caller: Return success
    else Failure
      Registry-->>Caller: Error/exception
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • dirixmjm

Poem

A rabbit taps the registry key, hop-hop—
No auto-adds, no sudden pop!
Requests go forth, callbacks wait,
Decoupled paths now designate.
Changelog carrots lined in a row—
344, 348—onward we go! 🥕

Pre-merge checks and finishing touches

✅ 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 succinctly describes the main intent—fixing auto-joining—and directly relates to the change that stops automatic MAC registration and discovery callback invocation in register_node; it is concise, specific, and informative enough for a reviewer to understand the primary fix.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-joining-bw

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02129cd and 13defa7.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
⏰ 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: Run pytest using Python 3.13

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 Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.78%. Comparing base (c0f1c33) to head (13defa7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
+ Coverage   81.67%   81.78%   +0.10%     
==========================================
  Files          36       36              
  Lines        8142     8140       -2     
==========================================
+ Hits         6650     6657       +7     
+ Misses       1492     1483       -9     

☔ 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.

@sonarqubecloud
Copy link

@bouwew bouwew marked this pull request as ready for review September 24, 2025 15:44
@bouwew bouwew requested a review from a team as a code owner September 24, 2025 15:44
@bouwew bouwew merged commit 3a56a74 into main Sep 24, 2025
16 of 17 checks passed
@bouwew bouwew deleted the fix-joining-bw branch September 24, 2025 15:44
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.

2 participants