homeassistant-config/pyscript/ir_remote_kitchenpi.py

34 lines
1.4 KiB
Python

from ir_helpers import *
@event_trigger("ir_command_received", "host == 'kitchenpi.fritz.box' and repeat_counter == 0")
def ir_remote_kitchenpi(button_name=None, **kwargs):
player = {'player': 'media_player.kitchenpi'}
mapping = {
**default_ir_light_control('group.living_area'),
**default_ir_cover_control('group.living_area'),
**default_ir_music_control(**player),
'btn_1': playlist_f('Fast Jazz', shuffle=True, **player),
'btn_2': playlist_f('Favorite Brass', shuffle=True, **player),
'btn_3': playlist_f("Pop", shuffle=True, **player),
'btn_4': playlist_f('Bar Classics', **player),
'btn_5': playlist_f('Sentimental Moods', **player),
'btn_6': playlist_f(URLS['spotify_merkliste'], **player),
'btn_7': radio_f('BR24', **player),
'btn_8': radio_f('BR-Klassik', **player),
'btn_9': playlist_f(URLS['klassik_radio'], **player),
'btn_0': radio_f('Bayern 3', **player),
'key_numeric_pound': radio_f('Bayern 2', **player),
'key_numeric_star': radio_f('Antenne Bayern', **player),
'key_red': scene_f('wohnbereich_orange'),
'key_green': scene_f('wohnbereich_grun'),
'key_yellow': scene_f('wohnbereich_hell'),
'key_blue': scene_f('wohnbereich_blau_grun'),
}
if button_name in mapping:
mapping[button_name]()