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

@@ -17,7 +17,6 @@ from homeassistant.exceptions import HomeAssistantError
from homeassistant.loader import bind_hass
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.loader import get_component
_LOGGER = logging.getLogger(__name__)
@@ -121,12 +120,12 @@ class ImageProcessingEntity(Entity):
This method is a coroutine.
"""
camera = get_component('camera')
camera = self.hass.components.camera
image = None
try:
image = yield from camera.async_get_image(
self.hass, self.camera_entity, timeout=self.timeout)
self.camera_entity, timeout=self.timeout)
except HomeAssistantError as err:
_LOGGER.error("Error on receive image from entity: %s", err)