1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00
This commit is contained in:
Paulus Schoutsen
2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View File

@@ -15,14 +15,18 @@ from . import EsphomeEntity, platform_async_setup_entry
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistantType,
entry: ConfigEntry, async_add_entities) -> None:
async def async_setup_entry(
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
) -> None:
"""Set up esphome cameras based on a config entry."""
await platform_async_setup_entry(
hass, entry, async_add_entities,
component_key='camera',
info_type=CameraInfo, entity_type=EsphomeCamera,
state_type=CameraState
hass,
entry,
async_add_entities,
component_key="camera",
info_type=CameraInfo,
entity_type=EsphomeCamera,
state_type=CameraState,
)
@@ -74,5 +78,5 @@ class EsphomeCamera(Camera, EsphomeEntity):
async def handle_async_mjpeg_stream(self, request):
"""Serve an HTTP MJPEG stream from the camera."""
return await camera.async_get_still_stream(
request, self._async_camera_stream_image,
camera.DEFAULT_CONTENT_TYPE, 0.0)
request, self._async_camera_stream_image, camera.DEFAULT_CONTENT_TYPE, 0.0
)