Updated denon component to play nice with the 3808CI that doesn't support NSFRN command (#10157)

This commit is contained in:
randellhodges 2017-10-27 07:22:23 -05:00 committed by Fabian Affolter
parent 85d7377beb
commit c0f8e6c5c5

View file

@ -78,7 +78,9 @@ class DenonDevice(MediaPlayerDevice):
def _setup_sources(self, telnet):
# NSFRN - Network name
self._name = self.telnet_request(telnet, 'NSFRN ?')[len('NSFRN '):]
nsfrn = self.telnet_request(telnet, 'NSFRN ?')[len('NSFRN '):]
if nsfrn:
self._name = nsfrn
# SSFUN - Configured sources with names
self._source_list = {}
@ -110,7 +112,7 @@ class DenonDevice(MediaPlayerDevice):
if all_lines:
return lines
return lines[0]
return lines[0] if lines else ''
def telnet_command(self, command):
"""Establish a telnet connection and sends `command`."""