mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
always output latest version of config file to webui (#307)
* always output latest version of config file to webui * fix permissions after default config export * tune code * set permissions for exported effects * use qt setperm instead of chmod update effects code style a bit * add fallback when config is not readable
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import hyperion, time, colorsys
|
||||
|
||||
# Get the parameters
|
||||
speed = float(hyperion.args.get('speed', 1.0))
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import math
|
||||
import hyperion, time, colorsys, math
|
||||
from random import random
|
||||
|
||||
# Get the parameters
|
||||
|
@@ -1,23 +1,21 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import hyperion, time, colorsys
|
||||
|
||||
# Get the parameters
|
||||
rotationTime = float(hyperion.args.get('rotation-time', 2.0))
|
||||
colorOne = hyperion.args.get('color_one', (255,0,0))
|
||||
colorTwo = hyperion.args.get('color_two', (0,0,255))
|
||||
colorsCount = hyperion.args.get('colors_count', hyperion.ledCount/2)
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
colorOne = hyperion.args.get('color_one', (255,0,0))
|
||||
colorTwo = hyperion.args.get('color_two', (0,0,255))
|
||||
colorsCount = hyperion.args.get('colors_count', hyperion.ledCount/2)
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
|
||||
# Check parameters
|
||||
rotationTime = max(0.1, rotationTime)
|
||||
colorsCount = min(hyperion.ledCount/2, colorsCount)
|
||||
colorsCoun t = min(hyperion.ledCount/2, colorsCount)
|
||||
|
||||
# Initialize the led data
|
||||
hsv1 = colorsys.rgb_to_hsv(colorOne[0]/255.0, colorOne[1]/255.0, colorOne[2]/255.0)
|
||||
hsv2 = colorsys.rgb_to_hsv(colorTwo[0]/255.0, colorTwo[1]/255.0, colorTwo[2]/255.0)
|
||||
hsv1 = colorsys.rgb_to_hsv(colorOne[0]/255.0, colorOne[1]/255.0, colorOne[2]/255.0)
|
||||
hsv2 = colorsys.rgb_to_hsv(colorTwo[0]/255.0, colorTwo[1]/255.0, colorTwo[2]/255.0)
|
||||
colorBlack = (0,0,0)
|
||||
ledData = bytearray()
|
||||
ledData = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
if i <= colorsCount:
|
||||
rgb = colorsys.hsv_to_rgb(hsv1[0], hsv1[1], hsv1[2])
|
||||
|
@@ -1,17 +1,15 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import hyperion, time, colorsys
|
||||
|
||||
# Get the parameters
|
||||
rotationTime = float(hyperion.args.get('rotation-time', 30.0))
|
||||
brightness = float(hyperion.args.get('brightness', 1.0))
|
||||
saturation = float(hyperion.args.get('saturation', 1.0))
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
brightness = float(hyperion.args.get('brightness', 1.0))
|
||||
saturation = float(hyperion.args.get('saturation', 1.0))
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
|
||||
# Check parameters
|
||||
rotationTime = max(0.1, rotationTime)
|
||||
brightness = max(0.0, min(brightness, 1.0))
|
||||
saturation = max(0.0, min(saturation, 1.0))
|
||||
brightness = max(0.0, min(brightness, 1.0))
|
||||
saturation = max(0.0, min(saturation, 1.0))
|
||||
|
||||
# Calculate the sleep time and hue increment
|
||||
sleepTime = 0.1
|
||||
|
@@ -8,7 +8,7 @@ centerY = float(hyperion.args.get('center_y', 0.5))
|
||||
|
||||
sleepTime = max(0.1, rotationTime) / 360
|
||||
angle = 0
|
||||
centerX = int(round(hyperion.imageWidth)*centerX)
|
||||
centerX = int(round(float(hyperion.imageWidth)*centerX))
|
||||
centerY = int(round(float(hyperion.imageHeight)*centerY))
|
||||
increment = -1 if reverse else 1
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import hyperion, time, colorsys
|
||||
|
||||
# Get the parameters
|
||||
sleepTime = float(hyperion.args.get('sleepTime', 1.0))
|
||||
|
Reference in New Issue
Block a user