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:
uvjustin 2022-06-08 02:10:53 +10:00 committed by GitHub
parent c6b835dd91
commit 73f2bca377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 92 additions and 67 deletions

View file

@ -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"}}
)