src/server/server.py
def emit_led_effect_setup(**params):
    '''Emits LED event/effect wiring options.'''
    if led_manager.isEnabled():
        effects = led_manager.getRegisteredEffects()

        emit_payload = {
            'events': []
        }

        for event in LEDEvent.configurable_events:
            selectedEffect = led_manager.getEventEffect(event['event'])

            effect_list = []

            for effect in effects:
                if event['event'] in effects[effect]['validEvents']:
                    effect_list.append({
                        'name': effect,
                        'label': __(effects[effect]['label'])
                    })

            emit_payload['events'].append({
                'event': event["event"],
                'label': __(event["label"]),
                'selected': selectedEffect,
                'effects': effect_list
            })

        # never broadcast
        emit('led_effect_setup_data', emit_payload)
Emits LED event/effect wiring options.
Emits LED event/effect wiring options.
Emits LED event / effect wiring options .
def emit_led_effect_setup(**params):
    if led_manager.isEnabled():
        effects = led_manager.getRegisteredEffects()
        emit_payload = {
            'events': []
        }
        for event in LEDEvent.configurable_events:
            selectedEffect = led_manager.getEventEffect(event['event'])
            effect_list = []
            for effect in effects:
                if event['event'] in effects[effect]['validEvents']:
                    effect_list.append({
                        'name': effect,
                        'label': __(effects[effect]['label'])
                    })
            emit_payload['events'].append({
                'event': event["event"],
                'label': __(event["label"]),
                'selected': selectedEffect,
                'effects': effect_list
            })
        emit('led_effect_setup_data', emit_payload)
def emit_led_effect_setup ( ** params ) : if led_manager . isEnabled ( ) : effects = led_manager . getRegisteredEffects ( ) emit_payload = { 'events' : [ ] } for event in LEDEvent . configurable_events : selectedEffect = led_manager . getEventEffect ( event [ 'event' ] ) effect_list = [ ] for effect in effects : if event [ 'event' ] in effects [ effect ] [ 'validEvents' ] : effect_list . append ( { 'name' : effect , 'label' : __ ( effects [ effect ] [ 'label' ] ) } ) emit_payload [ 'events' ] . append ( { 'event' : event [ "event" ] , 'label' : __ ( event [ "label" ] ) , 'selected' : selectedEffect , 'effects' : effect_list } ) emit ( 'led_effect_setup_data' , emit_payload )
Emits LED event/effect wiring options.
Emits LED event / effect wiring options .
'''Emits LED event/effect wiring options.''' # never broadcast