diff --git a/HMI/README.md b/HMI/README.md index 6414f1c7..16c3646a 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -129,7 +129,10 @@ The following message can be used to update the content on the cardEntities Page ### cardMedia Page -`entityUpd~*heading*~*navigation*~*internalNameEntiy*~*icon*~*title*~*author*~*volume*~*playpauseicon*~currentSpeaker~speakerList-seperated-by-?` +onoffbtn has to be`disable` to disable the on off btn +tIconBtnEntityName is the entiy name used in the button event for pressing the upper left icon + +`entityUpd~*heading*~*navigation*~*internalNameEntiy*~*icon*~*title*~*author*~*volume*~*playpauseicon*~currentSpeaker~speakerList-seperated-by-?~onoffbtn~tIconBtnEntityName` ### cardAlarm Page diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index ed2eeb5e..643fc49b 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index 977badff..8e95bfa5 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/README.md b/README.md index 29e5c929..f96011b5 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,7 @@ key | optional | type | default | description `title` | True | string | `None` | Title of the Page `entity` | False | string | `None` | contains the entity of the current card, valid for cardThermo, cardAlarm and cardMedia `key` | True | string | `None` | Used by navigate items +`mediaControl` | True | string | `None` | Only valid on cardMedia, contains the action executed on pressing the top left media icon. (useful to navigate to a hidden card or start a script) #### Possible configuration values for screensaver config diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index de5b63e0..39f253eb 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -329,7 +329,7 @@ class LuiPagesGen(object): command = f"entityUpd~{heading}~{navigation}~{item}~{current_temp} {temperature_unit}~{dest_temp}~{state_value}~{min_temp}~{max_temp}~{step_temp}{icon_res}~{currently_translation}~{state_translation}~{action_translation}~{temperature_unit_icon}" self._send_mqtt_msg(command) - def generate_media_page(self, navigation, title, entity): + def generate_media_page(self, navigation, title, entity, mediaBtn): item = entity.entityId if not self._ha_api.entity_exists(item): command = f"entityUpd~Not found~{navigation}~{item}~{get_icon_id('alert-circle-outline')}~Please check your~apps.yaml in AppDaemon~~0~{get_icon_id('alert-circle-outline')}~~~disable" @@ -360,7 +360,7 @@ class LuiPagesGen(object): onoffbutton = 1374 else: onoffbutton = rgb_dec565([255,152,0]) - command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}" + command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}~{mediaBtn}" self._send_mqtt_msg(command) def generate_alarm_page(self, navigation, entity): @@ -458,7 +458,8 @@ class LuiPagesGen(object): temp_unit = card.raw_config.get("temperatureUnit", "celsius") self.generate_thermo_page(navigation, card.title, card.entity, temp_unit) if card.cardType == "cardMedia": - self.generate_media_page(navigation, card.title, card.entity) + mediaBtn = card.raw_config.get("mediaControl", "") + self.generate_media_page(navigation, card.title, card.entity, mediaBtn) if card.cardType == "cardAlarm": self.generate_alarm_page(navigation, card.entity) if card.cardType == "screensaver":