From d3b3ce7630d524e82ff212cf658e99f1a6ea3064 Mon Sep 17 00:00:00 2001 From: snoerenberg Date: Wed, 9 Dec 2015 16:18:08 +0100 Subject: [PATCH] New X-Mas Effect added Former-commit-id: b5fb724f5b07f1cd55fef620c02f285522680cf6 --- effects/x-mas.json | 2 +- effects/x-mas.py | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/effects/x-mas.json b/effects/x-mas.json index 99bece03..72892a52 100644 --- a/effects/x-mas.json +++ b/effects/x-mas.json @@ -3,6 +3,6 @@ "script" : "x-mas.py", "args" : { - "frequency" : 50.0 + "sleepTime" : 0.75 } } diff --git a/effects/x-mas.py b/effects/x-mas.py index bdeda2e7..697d6f71 100644 --- a/effects/x-mas.py +++ b/effects/x-mas.py @@ -3,13 +3,7 @@ import time import colorsys # Get the parameters -frequency = float(hyperion.args.get('frequency', 10.0)) - -# Check parameters -frequency = min(100.0, frequency) - -# Compute the strobe interval -sleepTime = 1.0 / frequency +sleepTime = float(hyperion.args.get('sleepTime', 1.0)) # Initialize the led data ledDataOdd = bytearray() @@ -29,6 +23,6 @@ for i in range(hyperion.ledCount): # Start the write data loop while not hyperion.abort(): hyperion.setColor(ledDataOdd) - time.sleep(0.75) + time.sleep(sleepTime) hyperion.setColor(ledDataEven) - time.sleep(0.75) \ No newline at end of file + time.sleep(sleepTime) \ No newline at end of file