Async clientsession / fix stuff on aiohttp and camera platform (#4084)
* add websession * convert to websession * convert camera to async * fix lint * fix spell * add import * create task to loop * fix test * update aiohttp * fix tests part 2 * Update aiohttp.py
This commit is contained in:
1 parent
85747fe2ef
commit
3324995e70
5 files changed
+199
-121
No files matched your search
@@ -27,8 +27,9 @@ STATE_IDLE = 'idle'
|
||||
ENTITY_IMAGE_URL = '/api/camera_proxy/{0}?token={1}'
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=too-many-branches
|
||||
def setup(hass, config):
|
||||
def async_setup(hass, config):
|
||||
"""Setup the camera component."""
|
||||
component = EntityComponent(
|
||||
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL)
|
||||
@@ -36,8 +37,7 @@ def setup(hass, config):
|
||||
hass.http.register_view(CameraImageView(hass, component.entities))
|
||||
hass.http.register_view(CameraMjpegStream(hass, component.entities))
|
||||
|
||||
component.setup(config)
|
||||
|
||||
yield from component.async_setup(config)
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user