Added parameter value checks to effects

Former-commit-id: daf5d46862d9deeb12df56d262c7a0026a191a25
This commit is contained in:
johan
2013-12-01 15:22:51 +01:00
parent 515ae3e8c0
commit 9954cb3e0d
3 changed files with 14 additions and 0 deletions

View File

@@ -6,6 +6,10 @@ import colorsys
speed = hyperion.args.get('speed', 1.0)
fadeFactor = hyperion.args.get('fadeFactor', 0.7)
# Check parameters
speed = max(0.0001, speed)
fadeFactor = max(0.0, min(fadeFactor, 1.0))
# Initialize the led data
width = 25
imageData = bytearray(width * (0,0,0))