From 64ecbc2bc8cfb9a378d0994ef5d8e94d60dc3e6d Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Sun, 17 Oct 2021 11:56:59 -0700 Subject: [PATCH] Fix image example to use width and height --- docs/core/entity/camera.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/entity/camera.md b/docs/core/entity/camera.md index 04e3915f..a867e518 100644 --- a/docs/core/entity/camera.md +++ b/docs/core/entity/camera.md @@ -77,7 +77,7 @@ class MyCamera(Camera): The default `frontend_stream_type` is `STREAM_TYPE_HLS` which will use this stream source and the `stream` component to serve the RTSP stream with HLS. -A camera entity may also use the `stream_source` to render the preview image. +A camera entity may also use the `stream_source` to render a still camera image with `ffmpeg`. ```python from haffmpeg.tools import IMAGE_JPEG @@ -90,7 +90,7 @@ class MyCamera(Camera): ) -> bytes | None: """Return bytes of camera image.""" stream_url = await self.stream_source() - return await async_get_image(self.hass, stream_url, output_format=IMAGE_JPEG) + return await async_get_image(self.hass, stream_url, output_format=IMAGE_JPEG, width=width, height=height) ``` ### WebRTC Streams