def run():
    """ Run this effect until hyperion aborts. """
    effect = Effect()

    # Keep this thread alive
    while not hyperion.abort():
        time.sleep(1)

    effect.stop()
예제 #2
0
def run_json(host, port, interval):
    from app.json_client import JsonClient
    sleep_time = interval / 1000.0
    json_client = JsonClient(host, port)
    json_client.connect()
    while not hyperion.abort():
        json_client.send_led_data(hyperion.get_led_data())
        time.sleep(sleep_time)
    json_client.disconnect()
예제 #3
0
def run():
    """ Run this effect until hyperion aborts. """
    effect = Effect()

    # Keep this thread alive
    while not hyperion.abort():
        time.sleep(1)

    effect.stop()
예제 #4
0
def run_json(host, port, interval):
    from app.json_client import JsonClient
    sleep_time = interval / 1000.0
    json_client = JsonClient(host, port)
    json_client.connect()
    while not hyperion.abort():
        json_client.send_led_data(hyperion.get_led_data())
        time.sleep(sleep_time)
    json_client.disconnect()
예제 #5
0
def run_proto(host, port, interval):
    from lib.hyperion.Hyperion import Hyperion
    proto_client = Hyperion(host, port)
    sleep_time = interval / 1000.0
    while not hyperion.abort():
        w, h, c = hyperion.get_image_data()
        # print "Sending proto: {}, {}, {}\n".format(w, h, len(c))
        # if w < 1 or h < 1 or len(c) is not w*h*3:
        #     continue
        proto_client.sendImage(w, h, c)
        time.sleep(sleep_time)
예제 #6
0
def run_proto(host, port, interval):
    from lib.hyperion.Hyperion import Hyperion
    proto_client = Hyperion(host, port)
    sleep_time = interval / 1000.0
    while not hyperion.abort():
        w, h, c = hyperion.get_image_data()
        # print "Sending proto: {}, {}, {}\n".format(w, h, len(c))
        # if w < 1 or h < 1 or len(c) is not w*h*3:
        #     continue
        proto_client.sendImage(w, h, c)
        time.sleep(sleep_time)
예제 #7
0
    def receive_magnitudes(self, magnitudes):

        if hyperion.abort():
            self.stop()

        # Don't update when processing
        if self.processing:
            return
        else:
            self._magnitudes = magnitudes
            self.update_leds()
            hyperion.setColor(self._leds_data)
예제 #8
0
    def receive_magnitudes(self, magnitudes):

        if hyperion.abort():
            self.stop()

        # Don't update when processing
        if self.processing:
            return
        else:
            self._magnitudes = magnitudes
            self.update_leds()
            hyperion.setColor(self._leds_data)
예제 #9
0
    def receive_magnitudes(self, magnitudes):

        if hyperion.abort():
            self.stop()

        # Don't update when processing
        if self.processing:
            return
        else:
            self._magnitudes = magnitudes
            gain = max(0.3, self.mag_to_gain(0.5 * (self._magnitudes[0] + self._magnitudes[2])))
            
	    hyperion.setGain(gain)
예제 #10
0
def run():

    allEffects = AllEffects()
    randomSleepTime = allEffects.newRandomTime()
    allEffects.startEffect()

    # Keep this thread alive
    while not hyperion.abort():
        time.sleep(1)
        randomSleepTime -= 1
        if randomSleepTime <= 0:
            randomSleepTime = allEffects.newRandomTime()
            allEffects.startEffect()

    allEffects.effect.stop()