Import shuffle (#27935)

* Simplify persistent_notification ws command

* Move cors import inside setup

* Fix stream imports
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2019-10-19 12:44:51 -07:00
1 parent febc48c84b
commit bb5da77f2c
3 files changed
+12 -11

No files matched your search

+6 -2
View File
@@ -22,8 +22,6 @@ from .const import (
)
from .core import PROVIDERS
from .hls import async_setup_hls
from .recorder import async_setup_recorder
from .worker import stream_worker
try:
import uvloop
@@ -105,6 +103,9 @@ def request_stream(hass, stream_source, *, fmt="hls", keepalive=False, options=N
async def async_setup(hass, config):
"""Set up stream."""
# Keep import here so that we can import stream integration without installing reqs
from .recorder import async_setup_recorder
hass.data[DOMAIN] = {}
hass.data[DOMAIN][ATTR_ENDPOINTS] = {}
hass.data[DOMAIN][ATTR_STREAMS] = {}
@@ -182,6 +183,9 @@ class Stream:
def start(self):
"""Start a stream."""
# Keep import here so that we can import stream integration without installing reqs
from .worker import stream_worker
if self._thread is None or not self._thread.isAlive():
self._thread_quit = threading.Event()
self._thread = threading.Thread(