* Fix demo

* Fix types

* Fix all the things

* Fix type

* Fix test

* Lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2019-04-14 16:59:06 -07:00
1 parent 1d2e9b6915
commit 6b0180f753
20 files changed
+137 -200

No files matched your search

+6 -6
View File
@@ -157,7 +157,7 @@ def test_snapshot_service(hass, mock_camera):
async def test_websocket_camera_thumbnail(hass, hass_ws_client, mock_camera):
"""Test camera_thumbnail websocket command."""
await async_setup_component(hass, 'camera')
await async_setup_component(hass, 'camera', {})
client = await hass_ws_client(hass)
await client.send_json({
@@ -179,7 +179,7 @@ async def test_websocket_camera_thumbnail(hass, hass_ws_client, mock_camera):
async def test_websocket_stream_no_source(hass, hass_ws_client,
mock_camera, mock_stream):
"""Test camera/stream websocket command."""
await async_setup_component(hass, 'camera')
await async_setup_component(hass, 'camera', {})
with patch('homeassistant.components.camera.request_stream',
return_value='http://home.assistant/playlist.m3u8') \
@@ -203,7 +203,7 @@ async def test_websocket_stream_no_source(hass, hass_ws_client,
async def test_websocket_camera_stream(hass, hass_ws_client,
mock_camera, mock_stream):
"""Test camera/stream websocket command."""
await async_setup_component(hass, 'camera')
await async_setup_component(hass, 'camera', {})
with patch('homeassistant.components.camera.request_stream',
return_value='http://home.assistant/playlist.m3u8'
@@ -231,7 +231,7 @@ async def test_websocket_camera_stream(hass, hass_ws_client,
async def test_websocket_get_prefs(hass, hass_ws_client,
mock_camera):
"""Test get camera preferences websocket command."""
await async_setup_component(hass, 'camera')
await async_setup_component(hass, 'camera', {})
# Request preferences through websocket
client = await hass_ws_client(hass)
@@ -249,7 +249,7 @@ async def test_websocket_get_prefs(hass, hass_ws_client,
async def test_websocket_update_prefs(hass, hass_ws_client,
mock_camera, setup_camera_prefs):
"""Test updating preference."""
await async_setup_component(hass, 'camera')
await async_setup_component(hass, 'camera', {})
assert setup_camera_prefs[PREF_PRELOAD_STREAM]
client = await hass_ws_client(hass)
await client.send_json({
@@ -281,7 +281,7 @@ async def test_play_stream_service_no_source(hass, mock_camera, mock_stream):
async def test_handle_play_stream_service(hass, mock_camera, mock_stream):
"""Test camera play_stream service."""
await async_setup_component(hass, 'media_player')
await async_setup_component(hass, 'media_player', {})
data = {
ATTR_ENTITY_ID: 'camera.demo_camera',
camera.ATTR_MEDIA_PLAYER: 'media_player.test'