Make Stream.stop() async (#73107)
* Make Stream.start() async * Stop streams concurrently on shutdown Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
c6b835dd91
commit
73f2bca377
11 changed files with 92 additions and 67 deletions
|
@ -3,7 +3,7 @@ import asyncio
|
|||
import base64
|
||||
from http import HTTPStatus
|
||||
import io
|
||||
from unittest.mock import Mock, PropertyMock, mock_open, patch
|
||||
from unittest.mock import AsyncMock, Mock, PropertyMock, mock_open, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -410,6 +410,7 @@ async def test_preload_stream(hass, mock_stream):
|
|||
"homeassistant.components.demo.camera.DemoCamera.stream_source",
|
||||
return_value="http://example.com",
|
||||
):
|
||||
mock_create_stream.return_value.start = AsyncMock()
|
||||
assert await async_setup_component(
|
||||
hass, "camera", {DOMAIN: {"platform": "demo"}}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue