mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-15 09:26:58 +01:00
Update controller.py
This commit is contained in:
@@ -177,7 +177,10 @@ class LuiController(object):
|
|||||||
if button_type == "media-back":
|
if button_type == "media-back":
|
||||||
self._ha_api.get_entity(entity_id).call_service("media_previous_track")
|
self._ha_api.get_entity(entity_id).call_service("media_previous_track")
|
||||||
if button_type == "media-pause":
|
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":
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user