mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-23 16:04:25 +01:00
implemented speaker control on media page
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user