Beispiel #1
0
def configure(settings):
    LightSet.configure()
    lights = LightSet.get_instance()
    bind_instance(lights).to(i_controller.LightSet)
    lights.discover()

    single = bool(settings.get_value('single_light_discover', False))
    if not single:
        start_light_refresh()
Beispiel #2
0
def configure():
    # light name, group, location
    Lifx.inits = [('Table', 'Furniture', 'Home', [1, 2, 3, 4], False),
                  ('Top', 'Pole', 'Home', [10, 20, 30, 40], False),
                  ('Middle', 'Pole', 'Home', [100, 200, 300, 400], False),
                  ('Bottom', 'Pole', 'Home', [1000, 2000, 3000, 4000], False),
                  ('Chair', 'Furniture', 'Home', [10000, 20000, 30000,
                                                  4004], False),
                  ('Strip', 'Furniture', 'Home', [4, 3, 2, 1], True)]
    bind_instance(Lifx()).to(i_controller.Lifx)
Beispiel #3
0
def configure():
    injection.configure()

    settings_init = settings.using(config_values.functional)
    settings_init.add_overrides({'log_to_console': False})
    ini = os.getenv('BARDOLPH_INI')
    if ini:
        settings_init.apply_file(ini)
    settings_init.configure()

    light_module.configure()
    injection.bind_instance(web_app.WebApp()).to(i_web.WebApp)
Beispiel #4
0
from flask import Flask

from bardolph.lib import injection
from . import front_end
from . import web_module
"""
Root-level initialization occurs here, as this module is the first one loaded
by Flask to get the app object. That effectively makes this the "main" module.
"""
web_module.configure()
_flask_app = Flask(__name__)
_flask_app.register_blueprint(front_end.blueprint)
_flask_app.add_url_rule("/", endpoint="index")
injection.bind_instance(_flask_app).to(Flask)


def create_app():
    return injection.provide(Flask)
Beispiel #5
0
 def configure(self):
     bind_instance(Lifx()).to(i_controller.Lifx)
 def test_object(self):
     injection.configure()
     injection.bind_instance(ImplN(5)).to(Interface)
     self.assertEqual(5, call_impl())