Skip to content

components/xiaomi: Add initial discovery using NetDisco.#9283

Merged
balloob merged 1 commit into
home-assistant:devfrom
pfalcon:discover-xiaomi
Sep 13, 2017
Merged

components/xiaomi: Add initial discovery using NetDisco.#9283
balloob merged 1 commit into
home-assistant:devfrom
pfalcon:discover-xiaomi

Conversation

@pfalcon
Copy link
Copy Markdown
Contributor

@pfalcon pfalcon commented Sep 3, 2017

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:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

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

@pfalcon
Copy link
Copy Markdown
Contributor Author

pfalcon commented Sep 3, 2017

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.

@pfalcon
Copy link
Copy Markdown
Contributor Author

pfalcon commented Sep 3, 2017

@syssi , @rytilahti , @Danielhiversen : FYI

@syssi
Copy link
Copy Markdown
Member

syssi commented Sep 3, 2017

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.

Comment thread homeassistant/components/xiaomi.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see the lint warning (C: 68, 4: Missing function docstring (missing-docstring))? Please just add the docstring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@pfalcon
Copy link
Copy Markdown
Contributor Author

pfalcon commented Sep 9, 2017

The patch was updated to naming changes on NetDisco side home-assistant-libs/netdisco#144 (comment)

@balloob
Copy link
Copy Markdown
Member

balloob commented Sep 13, 2017

Netdisco update done in #9408

@balloob balloob merged commit d90801f into home-assistant:dev Sep 13, 2017
@balloob balloob mentioned this pull request Sep 22, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Mar 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants