Custom component loading cleanup (#14211)

* Clean up custom component loading

* Fix some tests

* Fix some stuff

* Make imports work again

* Fix tests

* Remove debug print

* Lint
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-05-01 20:57:30 +02:00
1 parent 5d96751168
commit 83d300fd11
50 files changed
+315 -392

No files matched your search

+1 -2
View File
@@ -12,7 +12,6 @@ import homeassistant.util as util
from homeassistant.components.light import (
Light, ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_TRANSITION,
SUPPORT_BRIGHTNESS, SUPPORT_COLOR_TEMP, SUPPORT_COLOR, SUPPORT_TRANSITION)
from homeassistant.loader import get_component
import homeassistant.util.color as color_util
DEPENDENCIES = ['wemo']
@@ -151,7 +150,7 @@ class WemoDimmer(Light):
@asyncio.coroutine
def async_added_to_hass(self):
"""Register update callback."""
wemo = get_component('wemo')
wemo = self.hass.components.wemo
# The register method uses a threading condition, so call via executor.
# and yield from to wait until the task is done.
yield from self.hass.async_add_job(