Fix uncaught Blink exceptions (#69770)
This commit is contained in:
parent
4a6ea5afd8
commit
4317daaf08
1 changed files with 10 additions and 1 deletions
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
|
||||
import logging
|
||||
|
||||
from requests.exceptions import ChunkedEncodingError
|
||||
|
||||
from homeassistant.components.camera import Camera
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -85,4 +87,11 @@ class BlinkCamera(Camera):
|
|||
self, width: int | None = None, height: int | None = None
|
||||
) -> bytes | None:
|
||||
"""Return a still image response from the camera."""
|
||||
return self._camera.image_from_cache.content
|
||||
try:
|
||||
return self._camera.image_from_cache.content
|
||||
except ChunkedEncodingError:
|
||||
_LOGGER.debug("Could not retrieve image for %s", self._camera.name)
|
||||
return None
|
||||
except TypeError:
|
||||
_LOGGER.debug("No cached image for %s", self._camera.name)
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue