mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix i/o in august camera async image update (#32044)
* Fix i/o in august camera image update * Address review comments
This commit is contained in:
parent
d4075fb262
commit
6e74ee7b64
@ -64,12 +64,17 @@ class AugustCamera(Camera):
|
|||||||
|
|
||||||
if self._image_url is not latest.image_url:
|
if self._image_url is not latest.image_url:
|
||||||
self._image_url = latest.image_url
|
self._image_url = latest.image_url
|
||||||
self._image_content = requests.get(
|
self._image_content = await self.hass.async_add_executor_job(
|
||||||
self._image_url, timeout=self._timeout
|
self._camera_image
|
||||||
).content
|
)
|
||||||
|
|
||||||
return self._image_content
|
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
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
"""Get the unique id of the camera."""
|
"""Get the unique id of the camera."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user