mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-18 10:57:01 +01:00
Update controller.py
This commit is contained in:
@@ -327,8 +327,8 @@ class LuiController(object):
|
|||||||
else:
|
else:
|
||||||
apis.ha_api.get_entity(entity_id).call_service("turn_off")
|
apis.ha_api.get_entity(entity_id).call_service("turn_off")
|
||||||
if button_type == "media-shuffle":
|
if button_type == "media-shuffle":
|
||||||
cur_suffle = apis.ha_api.get_entity(entity_id).shuffle
|
suffle = not apis.ha_api.get_entity(entity_id).shuffle
|
||||||
apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=!cur_suffle)
|
apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=suffle)
|
||||||
if button_type == "volumeSlider":
|
if button_type == "volumeSlider":
|
||||||
pos = int(value)
|
pos = int(value)
|
||||||
# HA wants this value between 0 and 1 as float
|
# 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)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
option = entity.attributes.effect_list[int(value)]
|
option = entity.attributes.effect_list[int(value)]
|
||||||
entity.call_service("select_effect", option=option)
|
entity.call_service("select_effect", option=option)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user