Update controller.py

This commit is contained in:
Johannes
2022-03-27 19:48:49 +02:00
committed by GitHub
parent 3d04f77961
commit d30fcf4157

View File

@@ -177,7 +177,10 @@ class LuiController(object):
if button_type == "media-back":
self._ha_api.get_entity(entity_id).call_service("media_previous_track")
if button_type == "media-pause":
self._ha_api.get_entity(entity_id).call_service("media_play_pause")
player = self._ha_api.get_entity(entity_id)
if player.state == "off":
player.call_service("turn_on")
player.call_service("media_play_pause")
if button_type == "volumeSlider":
pos = int(value)
# HA wants this value between 0 and 1 as float