예제 #1
0
def index():
    global startup_thread
    if startup_thread.is_alive():
        startup_thread.join()

    utility.display_check(sb_controller.get_screen_object())
    data = view_logic.get_index_data()
    zones = json.dumps(data['zones']) if data['zones'] else []

    helper = rgb_xy.ColorHelper()
    white = helper.get_rgb_from_xy_and_brightness(0.336, 0.360, 1)
    blue = helper.get_rgb_from_xy_and_brightness(0.167, 0.0399, 1)

    return render_template(
        '/home.html',
        update=data['update'],
        update_buffer=data['update_buffer'],
        max_bri=data['max_bri'],
        min_bri=data['min_bri'],
        default=data['default'],
        default_color=data['default_color'],
        black_rgb=data['black_rgb'],
        white=white,
        blue=blue,
        lights=data['lights'],
        lights_number=data['lights_number'],
        lightsJs=[1 if light[3] else 0 for light in data['lights']],
        icon_size=data['icon_size'],
        party_mode=data['party_mode'],
        zones=zones,
        zones_len=len(zones),
        zone_state=data['zone_state'],
        state=data['color_mode_enabled'],
        auto_start_state=int(data['auto_start_state']),
        screenshot=utility.get_screenshot(int(data['display_index'])),
        multi_monitor_screens=utility.get_multi_monitor_screenshots(),
        display_index=int(data['display_index']),
        color_mode=data['color_mode'],
        version=params.VERSION,
        environment=params.ENV,
        build=params.BUILD,
        js_path=js_path,
        css_path=css_path,
        images_path=images_path,
        fonts_path=fonts_path,
        audio_path=audio_path,
        presets=data['presets'],
        current_preset=data['current_preset'],
        fa_class_names=utility.get_fa_class_names(),
        title='Home')
예제 #2
0
def index():
    multi_screenshots = None
    if params.BUILD == 'win':
        utility.display_check(sb_controller.get_screen_object())
        multi_screenshots = utility.get_multi_monitor_screenshots()

    data = view_logic.get_index_data()
    zones = json.dumps(data['zones']) if data['zones'] else []

    helper = rgb_xy.ColorHelper()
    white = helper.get_rgb_from_xy_and_brightness(0.336, 0.360, 1)
    blue = helper.get_rgb_from_xy_and_brightness(0.167, 0.0399, 1)

    return render_template('/home.html',
                           update=data['update'],
                           update_buffer=data['update_buffer'],
                           max_bri=data['max_bri'],
                           min_bri=data['min_bri'],
                           default=data['default'],
                           white=white,
                           blue=blue,
                           lights=data['lights'],
                           lights_number=data['lights_number'],
                           lightsJs=[1 if light[3] else 0 for light in data['lights']],
                           icon_size=data['icon_size'],
                           party_mode=data['party_mode'],
                           zones=zones,
                           zones_len=len(zones),
                           zone_state=data['zone_state'],
                           state=data['state'],
                           auto_start_state=int(data['auto_start_state']),
                           screenshot=utility.get_screenshot(int(data['display_index'])),
                           multi_monitor_screens=multi_screenshots,
                           display_index=int(data['display_index']),
                           sat=data['sat'],
                           version=params.VERSION,
                           environment=params.ENV,
                           build=params.BUILD,
                           js_path=js_path,
                           css_path=css_path,
                           images_path=images_path,
                           fonts_path=fonts_path,
                           audio_path=audio_path,
                           presets=data['presets'],
                           current_preset=data['current_preset'],
                           fa_class_names=utility.get_fa_class_names(),
                           title='Home')