added optional node_id to MQTT discovery#8096
Conversation
|
@AlexMekkering, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @robbiet480 and @pvizeli to be potential reviewers. |
|
Hi @AlexMekkering, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
There was a problem hiding this comment.
You've changed the matching algorithm of an object id to no longer match the object id validation that Home Assistant enforces. Please revert.
18facb8 to
b5425a9
Compare
|
I've reverted the matching algo of the object_id (and treated the node_id alike) but I don't see why it should matter; the object_id isn't used for anything other then checking whether it was already discovered, it isn't passed to async_load_platform. |
|
It's called |
Description:
This PR adds support for an optional <node_id> level to MQTT discovery topics. This supports all config topics which match the pattern
<prefix_topic>/<component>/[<node_id>/]<object_id>/config.The purpose is to give other clients more means to only subscribe to their own command topics (e.g. when switches and/or lights are involved) by using one single wildcarded subscription topic like
homeassistant/+/<own_node_id>/+/setinstead of subscribing to every topic they're interested in.When multiple MQTT clients are involved, this will minimize the load on them because they'll only get their own topics forwarded by the MQTT server.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2840
Checklist:
toxrun successfully. Your PR cannot be merged unless tests pass