diff --git a/HMI/README.md b/HMI/README.md index ca09f7e9..d1ff239d 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -165,7 +165,7 @@ options are ? seperated 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*~iconcolor~*title*~titlecolor~*author*~authorcolor~*volume*~*playpauseicon*~currentSpeaker~speakerList-seperated-by-?~onoffbtn~tIconBtnEntityName` +`entityUpd~*heading*~*navigation*~*internalNameEntiy*~*icon*~iconcolor~*title*~titlecolor~*author*~authorcolor~*volume*~*playpauseicon*~currentSpeaker~speakerList-seperated-by-?~onoffbtn~tIconBtnEntityName,iconShuffle` ### cardAlarm Page diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 90781b97..d3c8170f 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index 34a6ebca..69a23df7 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 6d469570..407ddd8f 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -326,6 +326,9 @@ class LuiController(object): apis.ha_api.get_entity(entity_id).call_service("turn_on") else: apis.ha_api.get_entity(entity_id).call_service("turn_off") + if button_type == "media-shuffle": + cur_suffle = apis.ha_api.get_entity(entity_id).shuffle + apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=!cur_suffle) if button_type == "volumeSlider": pos = int(value) # HA wants this value between 0 and 1 as float diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 07e14c36..f8c4871d 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -501,7 +501,14 @@ 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}~{mediaBtn}" + shuffleBtn = "disable" + if bits & 0b100000000000000: + shuffle = get_attr_safe(entity, "shuffle", "") + if shuffle == False: + shuffleBtn = get_icon_id('shuffle-disabled') + elif shuffle == True: + shuffleBtn = get_icon_id('shuffle') + command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~~{title}~~{author}~~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}~{mediaBtn}~{shuffleBtn}" self._send_mqtt_msg(command) def generate_alarm_page(self, navigation, entity, overwrite_supported_modes, alarmBtn):