Conversation
houndci-bot
reviewed
May 1, 2018
| async def test_adding_unknown_device_to_config(mock_device_tracker_conf, hass): | ||
| """Test the adding of unknown devices to configuration file.""" | ||
| scanner = get_component('device_tracker.test').SCANNER | ||
| scanner = get_component(self.hass, 'device_tracker.test').SCANNER |
| return OrderedSet() | ||
|
|
||
| dep_load_order = _load_order_component(dependency, load_order, loading) | ||
| dep_load_order = _load_order_component(hass, dependency, load_order, loading) |
balloob
commented
May 1, 2018
| "dependencies are installed"), path) | ||
|
|
||
| _LOGGER.error("Unable to find component %s", comp_name) | ||
| def _load_module(path, name): |
Member
Author
There was a problem hiding this comment.
This didn't make much sense for me initially either, this blog post really helped: https://manikos.github.io/how-pythons-import-machinery-works
152dede to
d009c79
Compare
pvizeli
approved these changes
May 1, 2018
Member
|
Nice cleanup and usage of |
fanthos
added a commit
to fanthos/home-assistant
that referenced
this pull request
May 3, 2018
pvizeli
pushed a commit
that referenced
this pull request
May 4, 2018
3 tasks
3 tasks
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description:
Our custom component loading scheme was quite the hack. It mounts the config dir as a Python path and then does hacks doing
from custom_components import bla. However, this means that putting a Python scripts in your config dir would also make them loadable ! Create<config>/requests.pyand you will override the requests lib and break a bunch of things. Not good.So this is a rewrite. It will no longer mount the config dir, instead we load from the config dir based on name/path. We will also now cache the components and custom components on a per HASS instance basis, meaning that a bunch of tests that relied on 'test' component being set in another test, will break.
Breaking change: It's temporarily not possible to override scene or automation platforms unless they have the same config format as existing platform.
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: