Skip to content

Commit

Permalink
Fix media-OnOff
Browse files Browse the repository at this point in the history
  • Loading branch information
joBr99 authored Mar 29, 2022
1 parent 3d5aad7 commit 628a097
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/nspanel-lovelace-ui/luibackend/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def button_press(self, entity_id, button_type, value):
if button_type == "media-pause":
self._ha_api.get_entity(entity_id).call_service("media_play_pause")
if button_type == "media-OnOff":
if player.state == "off":
if self._ha_api.get_entity(entity_id).state == "off":
self._ha_api.get_entity(entity_id).call_service("turn_on")
else:
self._ha_api.get_entity(entity_id).call_service("turn_off")
Expand Down

0 comments on commit 628a097

Please sign in to comment.