Skip to content

Commit

Permalink
Merge pull request #15 from timniklas/timniklas-patch-1
Browse files Browse the repository at this point in the history
added default image on connection lost
  • Loading branch information
timniklas authored Nov 9, 2024
2 parents 2bfc6dc + 88e8f24 commit 8034c18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file added custom_components/ilifestyle/blank_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions custom_components/ilifestyle/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ async def async_camera_image(
) -> bytes | None:
"""Return a still image response from the camera."""

url = self._url
if self.is_streaming == False:
return None
url = "/config/custom_components/ilifestyle/blank_image.jpg"

return await ffmpeg.async_get_image(
self.hass,
self._url,
url,
output_format=IMAGE_JPEG,
extra_cmd=self._options,
)
Expand Down

0 comments on commit 8034c18

Please sign in to comment.