mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Handle connection errors talking to UVC cameras during image fetch
This requires uvcclient==0.6 which breaks out exceptions for us. Fixes #1244
This commit is contained in:
parent
3ced457089
commit
263839a336
@ -14,7 +14,7 @@ import requests
|
|||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.components.camera import DOMAIN, Camera
|
from homeassistant.components.camera import DOMAIN, Camera
|
||||||
|
|
||||||
REQUIREMENTS = ['uvcclient==0.5']
|
REQUIREMENTS = ['uvcclient==0.6']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -82,10 +82,17 @@ class UnifiVideoCamera(Camera):
|
|||||||
dict(name=self._name, addr=addr))
|
dict(name=self._name, addr=addr))
|
||||||
except socket.error:
|
except socket.error:
|
||||||
pass
|
pass
|
||||||
|
except uvc_camera.CameraConnectError:
|
||||||
|
pass
|
||||||
|
except uvc_camera.CameraAuthError:
|
||||||
|
pass
|
||||||
|
|
||||||
if not camera:
|
if not camera:
|
||||||
_LOGGER.error('Unable to login to camera')
|
_LOGGER.error('Unable to login to camera')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
camera.login()
|
try:
|
||||||
return camera.get_snapshot()
|
camera.login()
|
||||||
|
return camera.get_snapshot()
|
||||||
|
except uvc_camera.CameraConnectError:
|
||||||
|
_LOGGER.error('Failed to connect to camera %s', self._name)
|
||||||
|
@ -249,7 +249,7 @@ tellive-py==0.5.2
|
|||||||
transmissionrpc==0.11
|
transmissionrpc==0.11
|
||||||
|
|
||||||
# homeassistant.components.camera.uvc
|
# homeassistant.components.camera.uvc
|
||||||
uvcclient==0.5
|
uvcclient==0.6
|
||||||
|
|
||||||
# homeassistant.components.verisure
|
# homeassistant.components.verisure
|
||||||
vsure==0.5.0
|
vsure==0.5.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user