Fix i/o in august camera async image update (#32044)
* Fix i/o in august camera image update * Address review commentspull/32211/head
parent
a3b3ff52fc
commit
cc8430ebed
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue