implement shuffle button

This commit is contained in:
joBr99
2022-11-27 00:15:52 +01:00
parent 4afa570562
commit ed7cea97e1
5 changed files with 12 additions and 2 deletions

View File

@@ -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