From e7eb4438066a032d70ef9ee67e58173b33387353 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 22 Dec 2019 21:49:33 +0100 Subject: [PATCH] Klassik Radio fix & shuffle auf IR remote --- config_creation/ir_automations.py | 14 ++++++++++++-- custom_components/squeezebox_telnet/radio.py | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config_creation/ir_automations.py b/config_creation/ir_automations.py index 2d90d77..dd922b9 100644 --- a/config_creation/ir_automations.py +++ b/config_creation/ir_automations.py @@ -25,7 +25,7 @@ def get_config(): 'btn_7': '[radio] B 5 aktuell', 'btn_8': '[radio] BR-Klassik', - 'btn_9': '[playlist] http://opml.radiotime.com/Tune.ashx?id=s25028', # Klassik Radio + 'btn_9': '[playlist] http://opml.radiotime.com/Tune.ashx?id=s25028&formats=aac,ogg,mp3', # Klassik Radio 'key_numeric_star': '[radio] Antenne Bayern', 'btn_0': '[radio] Bayern 3', @@ -65,7 +65,7 @@ def get_config(): 'btn_7': '[radio] B 5 aktuell', 'btn_8': '[radio] BR-Klassik', - 'btn_9': '[playlist] http://opml.radiotime.com/Tune.ashx?id=s25028', # Klassik Radio + 'btn_9': '[playlist] http://opml.radiotime.com/Tune.ashx?id=s25028&formats=aac,ogg,mp3', # Klassik Radio 'key_numeric_star': '[radio] Antenne Bayern', 'btn_0': '[radio] Bayern 3', @@ -224,6 +224,16 @@ def default_music_controls(device_group, ir_host): 'trigger': ir_trigger(ir_host, 'key_volumedown'), 'action': service('media_player.volume_down', device_group), }, + { + 'alias': f'IR {ir_host} Shuffle On', + 'trigger': ir_trigger(ir_host, 'key_menu'), + 'action': service('media_player.shuffle_set', device_group, shuffle=True), + }, + { + 'alias': f'IR {ir_host} Shuffle Off', + 'trigger': ir_trigger(ir_host, 'key_exit'), + 'action': service('media_player.shuffle_set', device_group, shuffle=False), + }, ] diff --git a/custom_components/squeezebox_telnet/radio.py b/custom_components/squeezebox_telnet/radio.py index 579913a..c0ac28a 100644 --- a/custom_components/squeezebox_telnet/radio.py +++ b/custom_components/squeezebox_telnet/radio.py @@ -65,3 +65,7 @@ def find_local_radio_url_by_name(search_name): find_local_radio_url_by_name.stations = get_local_radio_stations() + + +if __name__ == '__main__': + print(find_local_radio_url_by_name("B 5 aktuell")) \ No newline at end of file