mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 16:34:25 +01:00
Do not display speaker selection item, in case there is only one speaker
This commit is contained in:
@@ -240,10 +240,13 @@ class LuiPagesGen(object):
|
||||
if entity.attributes.media_content_type == "music":
|
||||
icon = get_icon_id("music")
|
||||
source = entity.attributes.get("source", "")
|
||||
speakerlist = entity.attributes.get("source_list","")
|
||||
speakerlist = entity.attributes.get("source_list",[])
|
||||
if source in speakerlist:
|
||||
# move current source to the end of the list
|
||||
speakerlist.remove(source)
|
||||
speakerlist.append(source)
|
||||
if len(speakerlist) == 1:
|
||||
speakerlist = []
|
||||
speakerlist = "?".join(speakerlist)
|
||||
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist}"
|
||||
self._send_mqtt_msg(command)
|
||||
|
||||
Reference in New Issue
Block a user