Conversation
Add a function to retrieve commands based on capabilities.
Updated import statements and adjusted command handling logic.
Added a test for device-specific command resolution in capabilities.
Add a test to verify message retrieval using device commands.
Add unit tests for P2P device routing in MQTT client.
Refactor values assignment for clarity and consistency.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1772 +/- ##
==========================================
+ Coverage 96.26% 96.33% +0.06%
==========================================
Files 161 161
Lines 6399 6434 +35
Branches 368 379 +11
==========================================
+ Hits 6160 6198 +38
+ Misses 172 170 -2
+ Partials 67 66 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 30.42%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
monsivar
marked this pull request as ready for review
August 21, 2026 10:49
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactor command lookup so command classes can be resolved from the capabilities configured for a specific device, instead of relying only on the global command-name dictionaries.
This is a prerequisite for supporting different command implementations that use the same command name on different device families.
Motivation
This addresses the architectural blocker discussed in #1624.
The current global command lookup requires command names to be unique. That prevents, for example, registering two device-specific command classes that both use the same MQTT/API command name.
This PR adds a device-specific lookup while retaining the existing global registries as fallbacks for backwards compatibility.
Changes
Device capabilities
Capabilities.Capabilities.get_command(name).Legacy message lookup
COMMANDSlookup when no device-specific command is available.MQTT P2P lookup
q).p).Tests
Added coverage for:
Follow-up
Once this prerequisite is accepted, device families can safely select different command implementations with the same command name, including the mower
cleancommand work discussed in #1624.