Exemplo n.º 1
0
    while index + 1 < len(keys) and keys[index + 1] <= time:
        index += 1
    state = keys[index]

    # Run the mapped state if not previously run
    run = time_map[state]
    if last_state != run:
        run()
        last_state = run


# Enable the callback
dmx.ticker.set_interval(500)
dmx.ticker.set_callback(callback)

# Debug
callbacks = {
    "night": night,
    "day": day,
    "evening": evening,
    "late": late,
    "xmas": xmas,
}
dmx.web_control(callbacks=callbacks,
                timed_events={"you-will-be-found": get_timed_events(dmx)})
# dmx.debug_control(callbacks)

# Close the controller once we're done
dmx.sleep_till_enter()
dmx.close()
Exemplo n.º 2
0
from PyDMXControl.controllers import uDMXController as Controller
from PyDMXControl.profiles.Eyourlife import Small_Flat_Par
from PyDMXControl.profiles.Stairville import LED_Par_10mm, LED_Par_36

dmx = Controller()

# Fixtures
dmx.add_fixture(LED_Par_10mm)
dmx.add_fixture(LED_Par_36)
dmx.add_fixture(LED_Par_36)
dmx.add_fixture(LED_Par_36)
dmx.add_fixture(LED_Par_36)
dmx.add_fixture(Small_Flat_Par)
dmx.add_fixture(Small_Flat_Par)

# Web Debug
dmx.web_control()

# Dim all up
dmx.all_locate()

# Done
dmx.sleep_till_enter()
dmx.close()
Exemplo n.º 3
0
from timed_events_data import get_timed_events

from PyDMXControl.controllers import uDMXController as Controller

# Create controller and events
dmx = Controller(suppress_dmx_value_warnings=True)

# Load some fixtures from JSON
dmx.json.load_config('json/home.json')

# Get the timed events (contains the audio)
events = get_timed_events(dmx)

# Web Debug
dmx.web_control(timed_events={"you-will-be-found": events})

# Done
dmx.sleep_till_enter()
dmx.close()
Exemplo n.º 4
0
        if last_state != 0:
            dmx.all_off(10000)
            last_state = 0

    # Dim the lights before/after certain times
    if time >= 2100 or time <= 715:
        if last_state_type != 1:
            dimmer()
            last_state_type = 1
    else:
        if last_state_type != 0:
            normal()
            last_state_type = 0


# Enable the callback
dmx.ticker.set_interval(500)
dmx.ticker.set_callback(callback)

# Debug
callbacks = {
    "normal": normal,
    "dimmer": dimmer
}
dmx.web_control(callbacks=callbacks)
# dmx.debug_control(callbacks)

# Close the controller once we're done
dmx.sleep_till_enter()
dmx.close()
Exemplo n.º 5
0

def strobe():
    dmx.all_off()
    Dim.group_apply(dmx.get_all_fixtures(), 50)


def clear():
    dmx.all_locate()
    dmx.clear_all_effects()


# Web Debug
dmx.web_control(
    callbacks={
        "strobe": strobe,
        "clear": clear
    },
    host="0.0.0.0",
    port=80
)

# Web console is now accessible at http://0.0.0.0/ and will have two custom global callbacks for testing.

# Dim all up
dmx.all_locate()

# Done
dmx.sleep_till_enter()
dmx.close()