Skip to content

Commit 63e036d

Browse files
antoniocifujoostlek
authored andcommitted
Fix support for Hyperion 2.1.1 (home-assistant#156343)
Co-authored-by: Joost Lekkerkerker <[email protected]>
1 parent f0cbf34 commit 63e036d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

homeassistant/components/hyperion/camera.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from aiohttp import web
1414
from hyperion import client
1515
from hyperion.const import (
16+
KEY_DATA,
1617
KEY_IMAGE,
1718
KEY_IMAGE_STREAM,
1819
KEY_LEDCOLORS,
@@ -155,7 +156,8 @@ async def _update_imagestream(self, img: dict[str, Any] | None = None) -> None:
155156
"""Update Hyperion components."""
156157
if not img:
157158
return
158-
img_data = img.get(KEY_RESULT, {}).get(KEY_IMAGE)
159+
# Prefer KEY_DATA (Hyperion server >= 2.1.1); fall back to KEY_RESULT for older server versions
160+
img_data = img.get(KEY_DATA, img.get(KEY_RESULT, {})).get(KEY_IMAGE)
159161
if not img_data or not img_data.startswith(IMAGE_STREAM_JPG_SENTINEL):
160162
return
161163
async with self._image_cond:

0 commit comments

Comments
 (0)