mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix empty list in kodi media_player (#121250)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
98370fd9a0
commit
99476d9337
@ -641,12 +641,10 @@ class KodiEntity(MediaPlayerEntity):
|
||||
if self.state == MediaPlayerState.OFF:
|
||||
return state_attr
|
||||
|
||||
hdr_type = (
|
||||
self._item.get("streamdetails", {}).get("video", [{}])[0].get("hdrtype")
|
||||
)
|
||||
if hdr_type == "":
|
||||
state_attr["dynamic_range"] = "sdr"
|
||||
else:
|
||||
state_attr["dynamic_range"] = "sdr"
|
||||
if (video_details := self._item.get("streamdetails", {}).get("video")) and (
|
||||
hdr_type := video_details[0].get("hdrtype")
|
||||
):
|
||||
state_attr["dynamic_range"] = hdr_type
|
||||
|
||||
return state_attr
|
||||
|
Loading…
x
Reference in New Issue
Block a user