Skip to content

Commit 13ffb5e

Browse files
committed
ClientTimout when retrieving image
1 parent f46a955 commit 13ffb5e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

custom_components/lightcast/media_player.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ async def process_image(self, media_type: str, media_id: str) -> None:
8989
return
9090

9191
async with aiohttp.ClientSession() as session:
92-
async with session.get(media_id) as response:
92+
async with session.get(media_id,
93+
raise_for_status=True,
94+
timeout=aiohttp.ClientTimeout(total=30, connect=5)
95+
) as response:
9396
response_data = await response.read()
9497

9598
n_colors = len(valid_entities)

0 commit comments

Comments
 (0)