implemented speaker control on media page

This commit is contained in:
Johannes
2022-03-27 15:48:57 +02:00
parent a74043e4aa
commit 11fc578984
7 changed files with 15 additions and 7 deletions

View File

@@ -265,7 +265,13 @@ class LuiPagesGen(object):
if "media_content_type" in entity.attributes:
if entity.attributes.media_content_type == "music":
icon = get_icon_id("music")
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
source = entity.attributes.get("source", "")
speakerlist = entity.attributes.get("source_list","")
if source in speakerlist:
speakerlist.remove(source)
speakerlist.append(source)
speakerlist = "?".join(speakerlist)
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist}"
self._send_mqtt_msg(command)
def render_page(self, page, send_page_type=True):