Update controller.py

This commit is contained in:
Johannes
2022-11-28 17:27:40 +01:00
committed by GitHub
parent b31b521eb1
commit f096bcb44d

View File

@@ -327,8 +327,8 @@ class LuiController(object):
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)
suffle = not apis.ha_api.get_entity(entity_id).shuffle
apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=suffle)
if button_type == "volumeSlider":
pos = int(value)
# HA wants this value between 0 and 1 as float
@@ -401,4 +401,4 @@ class LuiController(object):
entity = apis.ha_api.get_entity(entity_id)
option = entity.attributes.effect_list[int(value)]
entity.call_service("select_effect", option=option)