from ir_helpers import * async def regal_licht_f(**kwargs): async def f(): await hass.services.async_call('light', 'turn_on', {'entity_id': "light.music_mouse_regal_licht", 'effect': 'static', **kwargs}) return f @event_trigger("ir_command_received", "host == 'musicmouse.fritz.box' and repeat_counter == 0 and remote == 'ir_led3'") def ir_remote_kinderzimmer(button_name=None, **kwargs): mapping = { 'key_on': scene_f('kinderzimmer_hell'), 'key_off': light_f("turn_off", entity_id="group.kids_room"), 'key_brightnessup': cover_f('open_cover', 'cover.kinderzimmer_rollo'), 'key_brightnessdown': cover_f('close_cover', 'cover.kinderzimmer_rollo'), 'key_white': scene_f('kinderzimmer_hell'), 'key_red': scene_f('kinderzimmer_wickeln_nachts'), 'key_pound': regal_licht_f(rgbw_color=[255, 30, 60, 0]), 'key_1': regal_licht_f(rgbw_color=[255, 30, 60, 0]), 'key_2': regal_licht_f(rgbw_color=[28, 255, 35, 0]), 'key_3': regal_licht_f(rgbw_color=[0, 0, 255, 0]), 'key_4': regal_licht_f(rgbw_color=[255, 156, 17, 0]), 'key_5': regal_licht_f(rgbw_color=[12, 166, 255, 0]), 'key_6': regal_licht_f(rgbw_color=[185, 10, 255, 0]), 'key_7': regal_licht_f(rgbw_color=[255, 156, 17, 0], brightness=50, effect="side_0.2_inc8"), 'key_8': regal_licht_f(rgbw_color=[0, 0, 255, 0], brightness=50, effect="side_0.2_inc8"), 'key_9': regal_licht_f(rgbw_color=[255, 30, 60, 0], brightness=50, effect="side_0.2_inc8"), } if button_name in mapping: mapping[button_name]() elif button_name == 'key_smooth': dimmer.dim(entity_id="light.music_mouse_regal_licht", offset=-30) elif button_name == 'key_fade': dimmer.dim(entity_id="light.music_mouse_regal_licht", offset=+30) @event_trigger("ir_command_received", "host == 'musicmouse.fritz.box' and repeat_counter == 0 and remote == 'Hauppauge'") def ir_remote_hauppauge_kinderzimmer(button_name=None, **kwargs): p = {'player': 'media_player.musicmouse'} mapping = { **default_ir_light_control('group.kids_room'), **default_ir_cover_control('group.kids_room'), **default_ir_music_control(**p), } if button_name in mapping: mapping[button_name]()