Skip to content

Fix so it is possible to ignore discovered config entry handlers#13741

Merged
balloob merged 2 commits intohome-assistant:devfrom
Kane610:allow-ignore-config-entry-discovery
Apr 7, 2018
Merged

Fix so it is possible to ignore discovered config entry handlers#13741
balloob merged 2 commits intohome-assistant:devfrom
Kane610:allow-ignore-config-entry-discovery

Conversation

@Kane610
Copy link
Copy Markdown
Member

@Kane610 Kane610 commented Apr 7, 2018

Description:

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

Comment thread homeassistant/components/discovery.py Outdated
vol.Optional(CONF_IGNORE, default=[]):
vol.All(cv.ensure_list, [vol.In(SERVICE_HANDLERS)])
vol.All(cv.ensure_list, [
vol.In({**CONFIG_ENTRY_HANDLERS, **SERVICE_HANDLERS})])
Copy link
Copy Markdown
Member

@balloob balloob Apr 7, 2018

Choose a reason for hiding this comment

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

This is inefficient, as you're creating a dictionary just to iterate over the keys. More efficient would be list(CONFIG_ENTRY_HANDLERS) + list(SERVICE_HANDLERS)

@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 7, 2018

This is fine for now. In the future, I want it to be possible for users to "decline" discovered config entries and we won't discover it again.

@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Apr 7, 2018

Sounds good, there is a lot of promise and possibilities with config entries

@balloob balloob merged commit f915a1c into home-assistant:dev Apr 7, 2018
@Kane610 Kane610 deleted the allow-ignore-config-entry-discovery branch April 7, 2018 21:30
@kellerza kellerza added this to the 0.67.1 milestone Apr 16, 2018
@kellerza
Copy link
Copy Markdown
Member

Fixes #13880

balloob pushed a commit that referenced this pull request Apr 18, 2018
)

* Fix so it is possible to ignore discovered config entry handlers

* Improve efficiency
@balloob balloob mentioned this pull request Apr 18, 2018
@balloob balloob removed this from the 0.67.1 milestone Apr 18, 2018
@balloob balloob mentioned this pull request Apr 27, 2018
@balloob balloob added this to the 0.67.1 milestone Apr 27, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 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.

5 participants