mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Use aiohttp.ClientTimeout for timeout (#122458)
This commit is contained in:
@@ -8,6 +8,7 @@ from datetime import timedelta
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import aiohttp
|
||||
from aiohttp import web
|
||||
from amcrest import AmcrestError
|
||||
from haffmpeg.camera import CameraMjpeg
|
||||
@@ -244,7 +245,9 @@ class AmcrestCam(Camera):
|
||||
websession = async_get_clientsession(self.hass)
|
||||
streaming_url = self._api.mjpeg_url(typeno=self._resolution)
|
||||
stream_coro = websession.get(
|
||||
streaming_url, auth=self._token, timeout=CAMERA_WEB_SESSION_TIMEOUT
|
||||
streaming_url,
|
||||
auth=self._token,
|
||||
timeout=aiohttp.ClientTimeout(total=CAMERA_WEB_SESSION_TIMEOUT),
|
||||
)
|
||||
|
||||
return await async_aiohttp_proxy_web(self.hass, request, stream_coro)
|
||||
|
||||
Reference in New Issue
Block a user