Refactor wled-tools discover_devices for deduplication and clarity#5493
Refactor wled-tools discover_devices for deduplication and clarity#5493
Conversation
Refactor discover_devices function to deduplicate device entries and improve readability.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 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 |
|
I am unsure why the original wled-tools has so many spaces after each line.. it makes the diff weird. |
@LordMike yeah probably the reason is "it doesn't matter". Normally we recommend "don't try to optimize out trailing whitespaces". As you say, it makes the diff hard to read and it makes cherry-picking between branches a nightmare. If you have any VSCode add-on that "optimizes" out trailing spaces, just remove them. Also don't use clang-format on the complete file before committing a PR. |
|
I cleaned it up |
Thanks, that's much clearer 👍 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
softhack007
left a comment
There was a problem hiding this comment.
looks fine for me.
I can't test it, but the only functional difference is print key => if (!seen[key]++) print key. everything else is just styling.
I've discovered that when we have multiple network interfaces, possible on different VLANs, which see the same mDNS entries, avahi will emit multiple entries (since it also keys on interface).
This change will make awk deduplicate, by only emitting unique name/ip/port pairs.
Summary by CodeRabbit