components/xiaomi: Add initial discovery using NetDisco.#9283
Conversation
|
@pfalcon, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Danielhiversen, @balloob and @fabaff to be potential reviewers. |
|
This is HA's counterpart for home-assistant-libs/netdisco#144 , requires NetDisco with that patch. So, as expected, with home-assistant-libs/netdisco#144 and this patch applied, HA automagically discovers Xiaomi Gateway present on a local network, and sensor, etc. sub-devices attached (wirelessly) to it. |
|
@syssi , @rytilahti , @Danielhiversen : FYI |
|
Awesome! Next step will be a nice UI which requests the key. :-) The tradfri platform is a nice reference. There need just a few lines to be written. I will give it a try if your feature is merged. |
There was a problem hiding this comment.
Did you see the lint warning (C: 68, 4: Missing function docstring (missing-docstring))? Please just add the docstring.
balloob
left a comment
There was a problem hiding this comment.
Ok to merge when netdisco counterpart merged.
There's a kind of duplication of functionality between NetDisco and "xiaomi" component, the latter features its own "discovery" in addition to general HomeAssistant discovery service, based on NetDisco. As such, this patch is pretty simple: the only purpose of NetDisco discovery is "plug and play", "zero configuration" discovery that Xiaomi Gateway device is present on the local network, and triggering of "xiaomi" component loading, which then "rediscovers" the gateway using its own method.
|
The patch was updated to naming changes on NetDisco side home-assistant-libs/netdisco#144 (comment) |
|
Netdisco update done in #9408 |
There's a kind of duplication of functionality between NetDisco and
"xiaomi" component, the latter features its own "discovery" in addition
to general HomeAssistant discovery service, based on NetDisco. As such,
this patch is pretty simple: the only purpose of NetDisco discovery
is "plug and play", "zero configuration" discovery that Xiaomi Gateway
device is present on the local network, and triggering of "xiaomi"
component loading, which then "rediscovers" the gateway using its own
method.
Description:
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass