From cc8430ebed699d17a43148b6e98cc0d2131c340a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 21 Feb 2020 00:39:07 -0600 Subject: [PATCH] Fix i/o in august camera async image update (#32044) * Fix i/o in august camera image update * Address review comments --- homeassistant/components/august/camera.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/august/camera.py b/homeassistant/components/august/camera.py index afc22716421..5426d9574dc 100644 --- a/homeassistant/components/august/camera.py +++ b/homeassistant/components/august/camera.py @@ -64,12 +64,17 @@ class AugustCamera(Camera): if self._image_url is not latest.image_url: self._image_url = latest.image_url - self._image_content = requests.get( - self._image_url, timeout=self._timeout - ).content + self._image_content = await self.hass.async_add_executor_job( + self._camera_image + ) return self._image_content + def _camera_image(self): + """Return bytes of camera image via http get.""" + # Move this to py-august: see issue#32048 + return requests.get(self._image_url, timeout=self._timeout).content + @property def unique_id(self) -> str: """Get the unique id of the camera."""