Fix 'Not Available' message for Onkyo integration (#38554)
This commit is contained in:
parent
a6236886e4
commit
061d88f875
1 changed files with 11 additions and 1 deletions
|
@ -239,6 +239,7 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
self._source_mapping = sources
|
self._source_mapping = sources
|
||||||
self._reverse_mapping = {value: key for key, value in sources.items()}
|
self._reverse_mapping = {value: key for key, value in sources.items()}
|
||||||
self._attributes = {}
|
self._attributes = {}
|
||||||
|
self._hdmi_out_supported = True
|
||||||
|
|
||||||
def command(self, command):
|
def command(self, command):
|
||||||
"""Run an eiscp command and catch connection errors."""
|
"""Run an eiscp command and catch connection errors."""
|
||||||
|
@ -251,6 +252,7 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
else:
|
else:
|
||||||
_LOGGER.info("%s is disconnected. Attempting to reconnect", self._name)
|
_LOGGER.info("%s is disconnected. Attempting to reconnect", self._name)
|
||||||
return False
|
return False
|
||||||
|
_LOGGER.debug("Result for %s: %s", command, result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
@ -268,7 +270,13 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
volume_raw = self.command("volume query")
|
volume_raw = self.command("volume query")
|
||||||
mute_raw = self.command("audio-muting query")
|
mute_raw = self.command("audio-muting query")
|
||||||
current_source_raw = self.command("input-selector query")
|
current_source_raw = self.command("input-selector query")
|
||||||
hdmi_out_raw = self.command("hdmi-output-selector query")
|
# If the following command is sent to a device with only one HDMI out,
|
||||||
|
# the display shows 'Not Available'.
|
||||||
|
# We avoid this by checking if HDMI out is supported
|
||||||
|
if self._hdmi_out_supported:
|
||||||
|
hdmi_out_raw = self.command("hdmi-output-selector query")
|
||||||
|
else:
|
||||||
|
hdmi_out_raw = []
|
||||||
preset_raw = self.command("preset query")
|
preset_raw = self.command("preset query")
|
||||||
if not (volume_raw and mute_raw and current_source_raw):
|
if not (volume_raw and mute_raw and current_source_raw):
|
||||||
return
|
return
|
||||||
|
@ -298,6 +306,8 @@ class OnkyoDevice(MediaPlayerEntity):
|
||||||
if not hdmi_out_raw:
|
if not hdmi_out_raw:
|
||||||
return
|
return
|
||||||
self._attributes["video_out"] = ",".join(hdmi_out_raw[1])
|
self._attributes["video_out"] = ",".join(hdmi_out_raw[1])
|
||||||
|
if hdmi_out_raw[1] == "N/A":
|
||||||
|
self._hdmi_out_supported = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue