mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix raising objects on proxy camera component
This commit is contained in:
parent
b246fc977e
commit
13144af65e
@ -71,16 +71,16 @@ def _precheck_image(image, opts):
|
|||||||
import io
|
import io
|
||||||
|
|
||||||
if not opts:
|
if not opts:
|
||||||
raise ValueError
|
raise ValueError()
|
||||||
try:
|
try:
|
||||||
img = Image.open(io.BytesIO(image))
|
img = Image.open(io.BytesIO(image))
|
||||||
except IOError:
|
except IOError:
|
||||||
_LOGGER.warning("Failed to open image")
|
_LOGGER.warning("Failed to open image")
|
||||||
raise ValueError
|
raise ValueError()
|
||||||
imgfmt = str(img.format)
|
imgfmt = str(img.format)
|
||||||
if imgfmt not in ('PNG', 'JPEG'):
|
if imgfmt not in ('PNG', 'JPEG'):
|
||||||
_LOGGER.warning("Image is of unsupported type: %s", imgfmt)
|
_LOGGER.warning("Image is of unsupported type: %s", imgfmt)
|
||||||
raise ValueError
|
raise ValueError()
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ class ProxyCamera(Camera):
|
|||||||
if not image:
|
if not image:
|
||||||
return None
|
return None
|
||||||
except HomeAssistantError:
|
except HomeAssistantError:
|
||||||
raise asyncio.CancelledError
|
raise asyncio.CancelledError()
|
||||||
|
|
||||||
if self._mode == MODE_RESIZE:
|
if self._mode == MODE_RESIZE:
|
||||||
job = _resize_image
|
job = _resize_image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user