Effects Configurator (#281)

* update translation

* add css

* Update JsonClientConnection.cpp

* add effectscreator

* remove udp

* fix title c/p issue for sparks

[skip ci]

* update schemas

[skip ci]

* typo

[skpi ci]
This commit is contained in:
brindosch
2016-10-30 17:54:38 +01:00
committed by GitHub
parent 33c91f73e3
commit 864538f188
20 changed files with 135 additions and 133 deletions

View File

@@ -14,7 +14,7 @@
"color-start": {
"type": "array",
"title":"Color Start",
"default": "255,174,11",
"default": [255,174,11],
"items" : {
"type": "integer",
"minimum": 0,
@@ -27,7 +27,7 @@
"color-end": {
"type": "array",
"title":"Color End",
"default": "100,100,100",
"default": [100,100,100],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -21,7 +21,7 @@
"color": {
"type": "array",
"title":"Color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -7,7 +7,7 @@
"color": {
"type": "array",
"title":"Color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -7,7 +7,7 @@
"color_one": {
"type": "array",
"title":"Color one",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,
@@ -20,7 +20,7 @@
"color_two": {
"type": "array",
"title":"Color two",
"default": "0,0,255",
"default": [0,0,255],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -14,7 +14,7 @@
"alarm-color": {
"type": "array",
"title":"Alarm color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,
@@ -27,7 +27,7 @@
"post-color": {
"type": "array",
"title":"Post color",
"default": "255,174,11",
"default": [255,174,11],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -7,7 +7,7 @@
"color": {
"type": "array",
"title":"Color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -7,7 +7,7 @@
"color_one": {
"type": "array",
"title":"Color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,
@@ -26,21 +26,21 @@
},
"sleep-time": {
"type": "number",
"title":"Rotation time",
"title":"Sleep time",
"default": 0.05,
"minimum" : 0.01,
"propertyOrder" : 3
},
"brightness": {
"type": "number",
"title":"Rotation time",
"title":"Brightness",
"default": 1.0,
"minimum" : 0.01,
"propertyOrder" : 4
},
"saturation": {
"type": "number",
"title":"Rotation time",
"title":"Saturation",
"default": 1.0,
"minimum" : 0.01,
"propertyOrder" : 5

View File

@@ -7,7 +7,7 @@
"color": {
"type": "array",
"title":"Color",
"default": "255,0,0",
"default": [255,0,0],
"items" : {
"type": "integer",
"minimum": 0,

View File

@@ -1,22 +0,0 @@
{
"type":"object",
"script" : "udp.py",
"title":"UDP listener",
"required":true,
"properties":{
"ListenPort": {
"type": "Integer",
"title":"Listen Port",
"default": 2801,
"minimum" : 1,
"propertyOrder" : 1
},
"ListenIP": {
"type": "string",
"title":"Listen IP",
"default": "",
"propertyOrder" : 2
}
},
"additionalProperties": false
}

View File

@@ -1,9 +0,0 @@
{
"name" : "UDP multicast listener",
"script" : "udp.py",
"args" :
{
"ListenPort" : 2801,
"ListenIP" : "239.255.28.01"
}
}

View File

@@ -1,8 +0,0 @@
{
"name" : "UDP listener",
"script" : "udp.py",
"args" :
{
"ListenPort" : 2391
}
}

View File

@@ -1,63 +0,0 @@
import hyperion
import time
import colorsys
import socket
import errno
import struct
# Get the parameters
ListenPort = int(hyperion.args.get('ListenPort', 2801))
ListenIP = hyperion.args.get('ListenIP', "")
octets = ListenIP.split('.');
UDPSock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM, socket.IPPROTO_UDP)
UDPSock.setblocking(False)
listen_addr = (ListenIP,ListenPort)
UDPSock.bind(listen_addr)
if ListenIP == "":
print "udp.py: Listening on *.*.*.*:"+str(ListenPort)
else:
print "udp.py: Listening on "+ListenIP+":"+str(ListenPort)
if len(octets) == 4 and int(octets[0]) >= 224 and int(octets[0]) < 240:
print "ListenIP is a multicast address\n"
# Multicast handling
try:
mreq = struct.pack("4sl", socket.inet_aton(ListenIP), socket.INADDR_ANY)
UDPSock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
except socket.error:
print "ERROR enabling multicast\n"
hyperion.setColor(hyperion.ledCount * bytearray((int(0), int(0), int(0))) )
# Start the write data loop
while not hyperion.abort():
try:
data,addr = UDPSock.recvfrom(4500)
# print data.strip(),len(data),addr
if (len(data)%3 == 0):
# print "numleds ",len(data)/3
ledData = bytearray()
for i in range(hyperion.ledCount):
if (i<(len(data)/3)):
ledData += data[i*3+0]
ledData += data[i*3+1]
ledData += data[i*3+2]
else:
ledData += bytearray((int(0), int(0), int(0)))
hyperion.setColor(ledData)
else:
print "not div 3"
except IOError as e:
if e.errno == errno.EWOULDBLOCK:
pass
else:
print "errno:", e.errno
print "udp.py: closing socket"
UDPSock.close()