From 8cacef47f34f471810a11316e2903a285b274bf2 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 17 Jan 2020 14:54:32 -0800 Subject: [PATCH] camera endpoint likes to timeout, catch it. (#30919) --- homeassistant/components/ring/camera.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/ring/camera.py b/homeassistant/components/ring/camera.py index 07d87c85714..1526a915482 100644 --- a/homeassistant/components/ring/camera.py +++ b/homeassistant/components/ring/camera.py @@ -6,6 +6,7 @@ import logging from haffmpeg.camera import CameraMjpeg from haffmpeg.tools import IMAGE_JPEG, ImageFrame +import requests from homeassistant.components.camera import Camera from homeassistant.components.ffmpeg import DATA_FFMPEG @@ -146,9 +147,15 @@ class RingCam(RingEntityMixin, Camera): ): return - video_url = await self.hass.async_add_executor_job( - self._device.recording_url, self._last_event["id"] - ) + try: + video_url = await self.hass.async_add_executor_job( + self._device.recording_url, self._last_event["id"] + ) + except requests.Timeout: + _LOGGER.warning( + "Time out fetching recording url for camera %s", self.entity_id + ) + video_url = None if video_url: self._last_video_id = self._last_event["id"]