From e9040f885dd341766f08de3dc01ce2c6004c511c Mon Sep 17 00:00:00 2001 From: redPanther Date: Thu, 30 Mar 2017 06:20:20 +0200 Subject: [PATCH] disable smoothing for effects (#425) * no smooth for efx rework fade effect * join strobe and fade effects new effect "breath" * - make transition efx to smooth mode more smooth - fixes for pacman - rework fade base effect - make it more versatile - fix prios in schema files - new notify blue effect to demonstrate capability of fade effect --- assets/webconfig/i18n/de.json | 6 +- assets/webconfig/i18n/en.json | 6 +- assets/webconfig/js/content_remote.js | 52 ++++++++----- effects/breath.json | 15 ++++ effects/candle.json | 2 +- effects/cinema-fade-in.json | 9 ++- effects/cinema-fade-off.json | 11 ++- effects/fade.py | 83 ++++++++++++++++++--- effects/notify-blue.json | 16 ++++ effects/pacman.json | 2 +- effects/pacman.py | 23 +++--- effects/schema/fade.schema.json | 56 +++++++++++--- effects/schema/strobe.schema.json | 31 -------- effects/strobe-blue.json | 9 --- effects/strobe-red.json | 15 ++++ effects/strobe-white.json | 12 ++- effects/strobe.py | 18 ----- libsrc/hyperion/Hyperion.cpp | 7 +- libsrc/hyperion/LinearColorSmoothing.cpp | 15 +++- libsrc/hyperion/LinearColorSmoothing.h | 6 ++ libsrc/hyperion/PriorityMuxer.cpp | 2 +- libsrc/jsonserver/JsonClientConnection.cpp | 2 +- libsrc/jsonserver/schema/schema-color.json | 2 +- libsrc/jsonserver/schema/schema-effect.json | 2 +- src/hyperiond/hyperiond.cpp | 2 +- 25 files changed, 271 insertions(+), 133 deletions(-) create mode 100644 effects/breath.json create mode 100644 effects/notify-blue.json delete mode 100644 effects/schema/strobe.schema.json delete mode 100644 effects/strobe-blue.json create mode 100644 effects/strobe-red.json delete mode 100644 effects/strobe.py diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index 2a28df5c..655f6485 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -602,7 +602,11 @@ "edt_eff_rotationtime_title" : "Rotationszeit", "edt_eff_sleeptime_title" : "Schlafzeit", "edt_eff_reversedirection_title" : "Richtung umkehren", - "edt_eff_fadetime_title" : "Übergangszeit", + "edt_eff_fadeintime_title" : "Zeit für Einblendung", + "edt_eff_fadeouttime_title" : "Zeit für Ausblendung", + "edt_eff_repeat_title" : "Wiederholung", + "edt_eff_colorendtime_title" : "Zeit für Start-Farbe", + "edt_eff_colorstarttime_title" : "Zeit für End-Farbe", "edt_eff_colorstart_title" : "Farbe Start", "edt_eff_colorend_title" : "Farbe Ende", "edt_eff_colorshift_title" : "Farbverschiebung", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 4149827b..bcb4202f 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -603,7 +603,11 @@ "edt_eff_rotationtime_title" : "Rotation time", "edt_eff_sleeptime_title" : "Sleep time", "edt_eff_reversedirection_title" : "Reverse direction", - "edt_eff_fadetime_title" : "Fade time", + "edt_eff_fadeintime_title" : "Fade in time", + "edt_eff_fadeouttime_title" : "Fade out time", + "edt_eff_repeat_title" : "Repeat", + "edt_eff_colorendtime_title" : "Time to hold start color", + "edt_eff_colorstarttime_title" : "Time to hold end color", "edt_eff_colorstart_title" : "Color start", "edt_eff_colorend_title" : "Color end", "edt_eff_colorshift_title" : "Color Shift", diff --git a/assets/webconfig/js/content_remote.js b/assets/webconfig/js/content_remote.js index b31e4e2e..25806868 100644 --- a/assets/webconfig/js/content_remote.js +++ b/assets/webconfig/js/content_remote.js @@ -106,41 +106,53 @@ $(document).ready(function() { var btn_type = "default"; var btn_text = $.i18n('remote_input_setsource_btn'); var btn_state = "enabled"; - if (active) btn_type = "primary"; + + if (active) + btn_type = "primary"; + + if(priority > 254) + continue; + if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") ) + clearAll = true; + if (visible) { btn_state = "disabled"; btn_type = "success"; btn_text = $.i18n('remote_input_sourceactiv_btn'); } + if(ip) origin += '
'+$.i18n('remote_input_ip')+' '+ip+''; - if(compId == "EFFECT") + + switch (compId) { - owner = $.i18n('remote_effects_label_effects')+' '+owner; - if(priority != 255) - clearAll = true; + case "EFFECT": + owner = $.i18n('remote_effects_label_effects')+' '+owner; + break; + case "COLOR": + owner = $.i18n('remote_color_label_color')+' '+'
'; + break; + case "GRABBER": + owner = $.i18n('general_comp_GRABBER')+': ('+owner+')'; + break; + case "V4L": + owner = $.i18n('general_comp_V4L')+': ('+owner+')'; + break; + case "BOBLIGHTSERVER": + owner = $.i18n('general_comp_BOBLIGHTSERVER'); + break; + case "UDPLISTENER": + owner = $.i18n('general_comp_UDPLISTENER'); + break; } - if(compId == "COLOR") - { - owner = $.i18n('remote_color_label_color')+' '+'
'; - if(priority != 255) - clearAll = true; - } - if(compId == "GRABBER") - owner = $.i18n('general_comp_GRABBER')+': ('+owner+')'; - if(compId == "V4L") - owner = $.i18n('general_comp_V4L')+': ('+owner+')'; - if(compId == "BOBLIGHTSERVER") - owner = $.i18n('general_comp_BOBLIGHTSERVER'); - if(compId == "UDPLISTENER") - owner = $.i18n('general_comp_UDPLISTENER'); + if(duration && compId != "GRABBER" && compId != "PROTOSERVER") owner += '
'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+''; var btn = ''; - if((compId == "EFFECT" || compId == "COLOR") && priority != 255) + if((compId == "EFFECT" || compId == "COLOR") && priority < 254) btn += ''; if(btn_type != 'default') diff --git a/effects/breath.json b/effects/breath.json new file mode 100644 index 00000000..fff886ae --- /dev/null +++ b/effects/breath.json @@ -0,0 +1,15 @@ +{ + "name" : "Breath", + "script" : "fade.py", + "args" : + { + "color-end": [ 255, 255, 255 ], + "color-start": [ 50, 50, 50 ], + "fade-in-time" : 4000, + "fade-out-time" : 1000, + "color-start-time" : 50, + "color-end-time" : 250, + "repeat-count" : 0, + "maintain-end-color" : true + } +} diff --git a/effects/candle.json b/effects/candle.json index 8a621c0b..6dc6938a 100644 --- a/effects/candle.json +++ b/effects/candle.json @@ -3,7 +3,7 @@ "script" : "candle.py", "args" : { - "sleepTime" : 0.15, + "sleepTime" : 0.20, "brightness" : 100, "color" : [ 255, 138, 0 ], "candles" : "all" diff --git a/effects/cinema-fade-in.json b/effects/cinema-fade-in.json index 2730c568..f2fdafff 100644 --- a/effects/cinema-fade-in.json +++ b/effects/cinema-fade-in.json @@ -3,8 +3,13 @@ "script" : "fade.py", "args" : { - "fade-time" : 5.0, "color-start" : [ 136, 97, 7 ], - "color-end" : [ 238, 173, 47 ] + "color-end" : [ 238, 173, 47 ], + "fade-in-time" : 5000, + "fade-out-time" : 0, + "color-start-time" : 0, + "color-end-time" : 0, + "repeat-count" : 1, + "maintain-end-color" : true } } diff --git a/effects/cinema-fade-off.json b/effects/cinema-fade-off.json index 7d7c20f8..1b385075 100644 --- a/effects/cinema-fade-off.json +++ b/effects/cinema-fade-off.json @@ -3,8 +3,13 @@ "script" : "fade.py", "args" : { - "fade-time" : 5.0, - "color-start" : [ 238, 173, 47 ], - "color-end" : [ 136, 97, 7 ] + "color-start" : [ 136, 97, 7 ], + "color-end" : [ 238, 173, 47 ], + "fade-in-time" : 0, + "fade-out-time" : 5000, + "color-start-time" : 0, + "color-end-time" : 0, + "repeat-count" : 1, + "maintain-end-color" : true } } diff --git a/effects/fade.py b/effects/fade.py index eb233a38..c71ea89e 100644 --- a/effects/fade.py +++ b/effects/fade.py @@ -1,27 +1,88 @@ import hyperion, time # Get the parameters -fadeTime = float(hyperion.args.get('fade-time', 5.0)) -colorStart = hyperion.args.get('color-start', (255,174,11)) -colorEnd = hyperion.args.get('color-end', (100,100,100)) +fadeInTime = float(hyperion.args.get('fade-in-time', 2000)) / 1000.0 +fadeOutTime = float(hyperion.args.get('fade-out-time', 2000)) / 1000.0 +colorStart = hyperion.args.get('color-start', (255,174,11)) +colorEnd = hyperion.args.get('color-end', (0,0,0)) +colorStartTime = float(hyperion.args.get('color-start-time', 1000)) / 1000 +colorEndTime = float(hyperion.args.get('color-end-time', 1000)) / 1000 +repeat = hyperion.args.get('repeat-count', 0) +maintainEndCol = hyperion.args.get('maintain-end-color', True) +minStepTime = 0.03 +currentR = currentG = currentB = 0 +# create color table for fading from start to end color color_step = ( (colorEnd[0] - colorStart[0]) / 256.0, (colorEnd[1] - colorStart[1]) / 256.0, (colorEnd[2] - colorStart[2]) / 256.0 ) -# fade color calcChannel = lambda i: min(max(int(colorStart[i] + color_step[i]*step),0),255) +colors = [] for step in range(256): - if hyperion.abort(): - break + colors.append( (calcChannel(0),calcChannel(1),calcChannel(2)) ) - hyperion.setColor( calcChannel(0),calcChannel(1),calcChannel(2) ) - time.sleep( fadeTime / 256 ) +# calculate timings +if fadeInTime>0: + incrementIn = max(1,int(round(256.0 / (fadeInTime / minStepTime) ))) + sleepTimeIn = fadeInTime / (256.0 / incrementIn) +else: + incrementIn = sleepTimeIn = 1 + +if fadeOutTime>0: + incrementOut = max(1,int(round(256.0 / (fadeOutTime / minStepTime) ))) + sleepTimeOut = fadeOutTime / (256.0 / incrementOut) +else: + incrementOut = sleepTimeOut = 1 -# maintain color until effect end -hyperion.setColor(colorEnd[0],colorEnd[1],colorEnd[2]) +def setColor(r,g,b): + global currentR,currentG,currentB + + currentR = r + currentG = g + currentB = b + hyperion.setColor(r,g,b) + +# loop +repeatCounter = 1 while not hyperion.abort(): - time.sleep(1) + # fade in + if fadeInTime > 0: + for step in range(0,256,incrementIn): + if hyperion.abort(): break + setColor( colors[step][0],colors[step][1],colors[step][2] ) + time.sleep(sleepTimeIn) + # end color + t = 0.0 + while t 0: + for step in range(255,-1,-incrementOut): + if hyperion.abort(): break + hyperion.setColor( colors[step][0],colors[step][1],colors[step][2] ) + time.sleep(sleepTimeOut) + + # start color + t = 0.0 + while t 0 and repeatCounter >= repeat : break + repeatCounter += 1 + +time.sleep(0.5) +# maintain end color until effect end +while not hyperion.abort() and maintainEndCol: + hyperion.setColor( currentR, currentG, currentB ) + time.sleep(1) + diff --git a/effects/notify-blue.json b/effects/notify-blue.json new file mode 100644 index 00000000..e8fa967b --- /dev/null +++ b/effects/notify-blue.json @@ -0,0 +1,16 @@ +{ + "name" : "Notify blue", + "script" : "fade.py", + "args" : + { + "color-start": [ 0, 0, 50 ], + "color-end": [ 0, 0, 255 ], + "fade-in-time" : 200, + "fade-out-time" : 100, + "color-start-time" : 40, + "color-end-time" : 150, + "repeat-count" : 3, + "maintain-end-color" : false + } +} + diff --git a/effects/pacman.json b/effects/pacman.json index a598e9c9..2fa76343 100644 --- a/effects/pacman.json +++ b/effects/pacman.json @@ -4,6 +4,6 @@ "args" : { "margin-pos" : 2.0, - "rotationTime" : 8 + "rotationTime" : 4 } } diff --git a/effects/pacman.py b/effects/pacman.py index bc05ff21..ded61bb3 100644 --- a/effects/pacman.py +++ b/effects/pacman.py @@ -1,17 +1,15 @@ -import hyperion -import time -import colorsys +import hyperion, time, colorsys from random import randint #get args -rotationTime = int(hyperion.args.get('rotationTime', 8)) -marginPos = float(hyperion.args.get('margin-pos', 1.5)) +rotationTime = float(hyperion.args.get('rotationTime', 4)) +marginPos = float(hyperion.args.get('margin-pos', 2)) # define pacman pacman = bytearray((255, 255, 0)) # define ghosts -redGuy = bytearray((255, 0, 0)) +redGuy = bytearray((255, 0, 0)) pinkGuy = bytearray((255, 184, 255)) blueGuy = bytearray((0, 255, 255)) slowGuy = bytearray((255, 184, 81)) @@ -20,10 +18,10 @@ light = bytearray((255, 184, 174)) background = bytearray((0, 0, 0)) #helper -posPac = 1 -diffPac = 6*marginPos -diffGuys = 3*marginPos -sleepTime = rotationTime/ledCount +posPac = 1 +diffPac = 6*marginPos +diffGuys = 3*marginPos +sleepTime = max(0.02,rotationTime/hyperion.ledCount) posPinkGuy = posPac + diffPac posBlueGuy = posPinkGuy + diffGuys @@ -89,7 +87,8 @@ while not hyperion.abort(): shiftLED(ledData, increment, hyperion.ledCount - random, s) # chase mode - shift = 3*(hyperion.ledCount - random) - ledData=ledDataChase[shift:]+ledDataChase[:shift] + shift = 3*(hyperion.ledCount - random) + ledData = ledDataChase[shift:]+ledDataChase[:shift] shiftLED(ledData, -increment, 2*hyperion.ledCount-random) + time.sleep(sleepTime) diff --git a/effects/schema/fade.schema.json b/effects/schema/fade.schema.json index 97256b6a..2f920be0 100644 --- a/effects/schema/fade.schema.json +++ b/effects/schema/fade.schema.json @@ -4,14 +4,6 @@ "title":"edt_eff_fade_header_title", "required":true, "properties":{ - "fade-time": { - "type": "number", - "title":"edt_eff_fadetime_title", - "default": 5.0, - "minimum" : 0.1, - "append" : "edt_append_s", - "propertyOrder" : 1 - }, "color-start": { "type": "array", "title":"edt_eff_colorstart_title", @@ -25,8 +17,24 @@ }, "minItems": 3, "maxItems": 3, + "propertyOrder" : 1 + }, + "color-start-time": { + "type": "integer", + "title":"edt_eff_colorstarttime_title", + "default": 1000, + "minimum" : 0, + "append" : "edt_append_ms", "propertyOrder" : 2 }, + "fade-in-time": { + "type": "integer", + "title":"edt_eff_fadeintime_title", + "default": 2000, + "minimum" : 0, + "append" : "edt_append_ms", + "propertyOrder" : 3 + }, "color-end": { "type": "array", "title":"edt_eff_colorend_title", @@ -39,8 +47,36 @@ }, "minItems": 3, "maxItems": 3, - "propertyOrder" : 3 - } + "propertyOrder" : 4 + }, + "color-end-time": { + "type": "integer", + "title":"edt_eff_colorendtime_title", + "default": 1000, + "minimum" : 0, + "append" : "edt_append_ms", + "propertyOrder" : 5 + }, + "fade-out-time": { + "type": "integer", + "title":"edt_eff_fadeouttime_title", + "default": 2000, + "minimum" : 0, + "append" : "edt_append_ms", + "propertyOrder" : 6 + }, + "repeat-count": { + "type": "integer", + "title":"edt_eff_repeatcount_title", + "default": 0, + "propertyOrder" : 7 + }, + "maintain-end-color": { + "type": "boolean", + "title":"edt_eff_maintain_end_color_title", + "default": true, + "propertyOrder" : 8 + } }, "additionalProperties": false } diff --git a/effects/schema/strobe.schema.json b/effects/schema/strobe.schema.json deleted file mode 100644 index a8f76c12..00000000 --- a/effects/schema/strobe.schema.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type":"object", - "script" : "strobe.py", - "title":"edt_eff_storbe_header_title", - "required":true, - "properties":{ - "color": { - "type": "array", - "title":"edt_eff_color_title", - "format":"colorpicker", - "default": [255,0,0], - "items" : { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "minItems": 3, - "maxItems": 3, - "propertyOrder" : 1 - }, - "frequency": { - "type": "number", - "title":"edt_eff_frequency_title", - "default": 10.0, - "minimum" : 0.1, - "append" : "edt_append_hz", - "propertyOrder" : 2 - } - }, - "additionalProperties": false -} diff --git a/effects/strobe-blue.json b/effects/strobe-blue.json deleted file mode 100644 index f6b643e7..00000000 --- a/effects/strobe-blue.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name" : "Strobe blue", - "script" : "strobe.py", - "args" : - { - "color" : [ 0, 0, 255 ], - "frequency" : 5.0 - } -} diff --git a/effects/strobe-red.json b/effects/strobe-red.json new file mode 100644 index 00000000..d82cc7a4 --- /dev/null +++ b/effects/strobe-red.json @@ -0,0 +1,15 @@ +{ + "name" : "Strobe red", + "script" : "fade.py", + "args" : + { + "color-start": [ 255, 0, 0 ], + "color-end": [ 0, 0, 0 ], + "fade-in-time" : 100, + "fade-out-time" : 100, + "color-start-time" : 100, + "color-end-time" : 100, + "repeat-count" : 0, + "maintain-end-color" : true + } +} diff --git a/effects/strobe-white.json b/effects/strobe-white.json index 95b92a7f..3e946ca3 100644 --- a/effects/strobe-white.json +++ b/effects/strobe-white.json @@ -1,9 +1,15 @@ { "name" : "Strobe white", - "script" : "strobe.py", + "script" : "fade.py", "args" : { - "color" : [ 255, 255, 255 ], - "frequency" : 5.0 + "color-start": [ 255, 255, 255 ], + "color-end": [ 0, 0, 0 ], + "fade-in-time" : 0, + "fade-out-time" : 100, + "color-start-time" : 50, + "color-end-time" : 10, + "repeat-count" : 0, + "maintain-end-color" : true } } diff --git a/effects/strobe.py b/effects/strobe.py deleted file mode 100644 index fa5a1d7f..00000000 --- a/effects/strobe.py +++ /dev/null @@ -1,18 +0,0 @@ -import hyperion, time - -# Get the rotation time -color = hyperion.args.get('color', (255,255,255)) -frequency = float(hyperion.args.get('frequency', 10.0)) - -# Check parameters -frequency = min(100.0, frequency) - -# Compute the strobe interval -sleepTime = 0.5 / frequency - -# Start the write data loop -while not hyperion.abort(): - hyperion.setColor(0, 0, 0) - time.sleep(sleepTime) - hyperion.setColor(color[0], color[1], color[2]) - time.sleep(sleepTime) diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 8147d760..fc9c2f6e 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -846,9 +846,12 @@ void Hyperion::update() // Write the data to the device if (_device->enabled()) { - if (_deviceSmooth->enabled()) + _deviceSmooth->setPause(priorityInfo.componentId == hyperion::COMP_EFFECT); + // feed smoothing in pause mode to maintain a smooth transistion back to smoth mode + if (_deviceSmooth->enabled() || _deviceSmooth->pause()) _deviceSmooth->setLedValues(_ledBuffer); - else + + if (! _deviceSmooth->enabled()) _device->setLedValues(_ledBuffer); } diff --git a/libsrc/hyperion/LinearColorSmoothing.cpp b/libsrc/hyperion/LinearColorSmoothing.cpp index 8fae26a6..0fea4d5c 100644 --- a/libsrc/hyperion/LinearColorSmoothing.cpp +++ b/libsrc/hyperion/LinearColorSmoothing.cpp @@ -17,6 +17,7 @@ LinearColorSmoothing::LinearColorSmoothing( LedDevice * ledDevice, double ledUpd , _outputDelay(updateDelay) , _writeToLedsEnable(true) , _continuousOutput(continuousOutput) + , _pause(false) { _log = Logger::getInstance("Smoothing"); _timer.setSingleShot(false); @@ -118,7 +119,7 @@ void LinearColorSmoothing::queueColors(const std::vector & ledColors) if (_outputDelay == 0) { // No output delay => immediate write - if ( _writeToLedsEnable ) + if ( _writeToLedsEnable && !_pause) _ledDevice->setLedValues(ledColors); } else @@ -132,7 +133,10 @@ void LinearColorSmoothing::queueColors(const std::vector & ledColors) { if ( _outputQueue.size() > _outputDelay || !_writeToLedsEnable ) { - _ledDevice->setLedValues(_outputQueue.front()); + if (!_pause) + { + _ledDevice->setLedValues(_outputQueue.front()); + } _outputQueue.pop_front(); } } @@ -148,6 +152,11 @@ void LinearColorSmoothing::setEnable(bool enable) { _timer.stop(); _previousValues.clear(); - } } + +void LinearColorSmoothing::setPause(bool pause) +{ + _pause = pause; +} + diff --git a/libsrc/hyperion/LinearColorSmoothing.h b/libsrc/hyperion/LinearColorSmoothing.h index d50e2fc7..bcb00a26 100644 --- a/libsrc/hyperion/LinearColorSmoothing.h +++ b/libsrc/hyperion/LinearColorSmoothing.h @@ -41,6 +41,9 @@ public: virtual int switchOff(); void setEnable(bool enable); + void setPause(bool pause); + bool pause() { return _pause; } ; + bool enabled() { return LedDevice::enabled() && !_pause; }; private slots: /// Timer callback which writes updated led values to the led device @@ -88,4 +91,7 @@ private: /// Flag for dis/enable continuous output to led device regardless there is new data or not bool _continuousOutput; + + /// Flag for pausing + bool _pause; }; diff --git a/libsrc/hyperion/PriorityMuxer.cpp b/libsrc/hyperion/PriorityMuxer.cpp index fc636377..611d0650 100644 --- a/libsrc/hyperion/PriorityMuxer.cpp +++ b/libsrc/hyperion/PriorityMuxer.cpp @@ -78,7 +78,7 @@ void PriorityMuxer::clearAll() { for(auto key : _activeInputs.keys()) { - if (key < LOWEST_PRIORITY) + if (key < LOWEST_PRIORITY-1) { _activeInputs.remove(key); } diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 6bdc24bc..08992d7a 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -617,7 +617,7 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt const Hyperion::InputInfo & priorityInfo = _hyperion->getPriorityInfo(priority); QJsonObject item; item["priority"] = priority; - if (priorityInfo.timeoutTime_ms != -1 && (priorityInfo.componentId == hyperion::COMP_COLOR || priorityInfo.componentId == hyperion::COMP_EFFECT)) + if (priorityInfo.timeoutTime_ms != -1 ) { item["duration_ms"] = int(priorityInfo.timeoutTime_ms - now); } diff --git a/libsrc/jsonserver/schema/schema-color.json b/libsrc/jsonserver/schema/schema-color.json index ea4c82ee..316cbe80 100644 --- a/libsrc/jsonserver/schema/schema-color.json +++ b/libsrc/jsonserver/schema/schema-color.json @@ -13,7 +13,7 @@ "priority": { "type": "integer", "minimum" : 1, - "maximum" : 254, + "maximum" : 253, "required": true }, "duration": { diff --git a/libsrc/jsonserver/schema/schema-effect.json b/libsrc/jsonserver/schema/schema-effect.json index 679fd64a..dfd58b59 100644 --- a/libsrc/jsonserver/schema/schema-effect.json +++ b/libsrc/jsonserver/schema/schema-effect.json @@ -13,7 +13,7 @@ "priority": { "type": "integer", "minimum" : 1, - "maximum" : 254, + "maximum" : 253, "required": true }, "duration": { diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index cbb4d71d..172f7c9b 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -210,7 +210,7 @@ void HyperionDaemon::startInitialEffect() const QJsonObject & BGEffectConfig = _qconfig["backgroundEffect"].toObject(); const int FG_PRIORITY = 0; const int DURATION_INFINITY = 0; - const int BG_PRIORITY = PriorityMuxer::LOWEST_PRIORITY; + const int BG_PRIORITY = PriorityMuxer::LOWEST_PRIORITY-1; // clear the leds hyperion->setColor(FG_PRIORITY, ColorRgb::BLACK, 100, false);