mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
lg_netcast platform fails to load if no channels defined (#4083)
* fixes loading of lg_netcast platform if no channels are defined * turned list comprehension into for loop
This commit is contained in:
parent
3317b4916b
commit
3f6a5564ad
@ -103,8 +103,11 @@ class LgTVDevice(MediaPlayerDevice):
|
||||
|
||||
channel_list = client.query_data('channel_list')
|
||||
if channel_list:
|
||||
channel_names = [str(c.find('chname').text) for
|
||||
c in channel_list]
|
||||
channel_names = []
|
||||
for channel in channel_list:
|
||||
channel_name = channel.find('chname')
|
||||
if channel_name is not None:
|
||||
channel_names.append(str(channel_name.text))
|
||||
self._sources = dict(zip(channel_names, channel_list))
|
||||
# sort source names by the major channel number
|
||||
source_tuples = [(k, self._sources[k].find('major').text)
|
||||
|
Loading…
x
Reference in New Issue
Block a user