Fix onkyo UnboundLocalError (#53793)
audio_information_raw and video_information_raw were in some cases used before being assigned error: UnboundLocalError: local variable 'video_information_raw' referenced before assignmentpull/53802/head
parent
c6a2e247fe
commit
172769d19c
|
@ -319,8 +319,10 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
preset_raw = self.command("preset query")
|
preset_raw = self.command("preset query")
|
||||||
if self._audio_info_supported:
|
if self._audio_info_supported:
|
||||||
audio_information_raw = self.command("audio-information query")
|
audio_information_raw = self.command("audio-information query")
|
||||||
|
self._parse_audio_information(audio_information_raw)
|
||||||
if self._video_info_supported:
|
if self._video_info_supported:
|
||||||
video_information_raw = self.command("video-information query")
|
video_information_raw = self.command("video-information query")
|
||||||
|
self._parse_video_information(video_information_raw)
|
||||||
if not (volume_raw and mute_raw and current_source_raw):
|
if not (volume_raw and mute_raw and current_source_raw):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -343,9 +345,6 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
self._receiver_max_volume * self._max_volume / 100
|
self._receiver_max_volume * self._max_volume / 100
|
||||||
)
|
)
|
||||||
|
|
||||||
self._parse_audio_information(audio_information_raw)
|
|
||||||
self._parse_video_information(video_information_raw)
|
|
||||||
|
|
||||||
if not hdmi_out_raw:
|
if not hdmi_out_raw:
|
||||||
return
|
return
|
||||||
self._attributes[ATTR_VIDEO_OUT] = ",".join(hdmi_out_raw[1])
|
self._attributes[ATTR_VIDEO_OUT] = ",".join(hdmi_out_raw[1])
|
||||||
|
|
Loading…
Reference in New Issue