diff --git a/HMI/README.md b/HMI/README.md index a6f79944..875761c7 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -129,7 +129,7 @@ The following message can be used to update the content on the cardEntities Page ### cardMedia Page -`entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*` +`entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*|currentSpeaker|speakerList-seperated-by-?` ### cardAlarm Page diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 80b143a2..2c6234ad 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index 1eb3dca8..60fb2b51 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 3f9d6888..4dc611e9 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -178,14 +178,14 @@ class LuiController(object): self._ha_api.get_entity(entity_id).call_service("media_previous_track") if button_type == "media-pause": self._ha_api.get_entity(entity_id).call_service("media_play_pause") - if button_type == "hvac_action": - self._ha_api.get_entity(entity_id).call_service("set_hvac_mode", hvac_mode=value) if button_type == "volumeSlider": pos = int(value) # HA wants this value between 0 and 1 as float pos = pos/100 self._ha_api.get_entity(entity_id).call_service("volume_set", volume_level=pos) - + if button_type == "speaker-sel": + self._ha_api.get_entity(entity_id).call_service("select_source", source=value) + # for light detail page if button_type == "brightnessSlider": # scale 0-100 to ha brightness range @@ -207,3 +207,5 @@ class LuiController(object): if button_type == "tempUpd": temp = int(value)/10 self._ha_api.get_entity(entity_id).call_service("set_temperature", temperature=temp) + if button_type == "hvac_action": + self._ha_api.get_entity(entity_id).call_service("set_hvac_mode", hvac_mode=value) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index dcf916f5..e77597fd 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -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): diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index 068ec6d2..0483fd3a 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -64,8 +64,8 @@ class NsPanelLovelaceUIManager(hass.Hass): controller = LuiController(self, cfg, send_mqtt_msg) - desired_display_firmware_version = 19 - desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-v1.8.3.tft" + desired_display_firmware_version = 20 + desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-v1.9.0.tft" desired_tasmota_driver_version = 3 desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be" diff --git a/doc-pics/screens.png b/doc-pics/screens.png index da3ee02b..8274acf4 100644 Binary files a/doc-pics/screens.png and b/doc-pics/screens.png differ