Implement async_get_stream_source in the camera integration (#35704)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-05-25 15:41:50 -07:00
1 parent 6fbc3c4a51
commit 3dfeec5033
3 files changed
+24 -6

No files matched your search

@@ -161,6 +161,14 @@ async def async_get_image(hass, entity_id, timeout=10):
raise HomeAssistantError("Unable to get image")
@bind_hass
async def async_get_stream_source(hass, entity_id):
"""Fetch the stream source for a camera entity."""
camera = _get_camera_from_entity_id(hass, entity_id)
return await camera.stream_source()
@bind_hass
async def async_get_mjpeg_stream(hass, request, entity_id):
"""Fetch an mjpeg stream from a camera entity."""