Updated Mobile UI

Fixed Smooth Meteor stuck pixels
Added CORS response
Added secondary color to http API response
This commit is contained in:
cschwinne 2019-01-18 01:20:36 +01:00
parent 6ebef8846c
commit c5cc0b3f2b
10 changed files with 1315 additions and 1316 deletions

View File

@ -2,7 +2,7 @@
#ifndef NpbWrapper_h
#define NpbWrapper_h
#define WORKAROUND_ESP32_BITBANG
//#define WORKAROUND_ESP32_BITBANG
//see https://github.com/Aircoookie/WLED/issues/2 for flicker free ESP32 support
//PIN CONFIGURATION
@ -19,12 +19,12 @@
#define PIXELMETHOD NeoEsp32BitBangWs2813Method
#pragma message "Software BitBang is used because of your NeoPixelBus version. Look in NpbWrapper.h for instructions on how to mitigate flickering."
#else
#define PIXELMETHOD NeoEsp32RmtWS2813_V3Method
#define PIXELMETHOD NeoWs2813Method
#endif
#else //esp8266
//autoselect the right method depending on strip pin
#if LEDPIN == 2
#define PIXELMETHOD NeoEsp8266Uart1Ws2813Method //if you get an error here, please update to Neopixelbus v2.4.0+
#define PIXELMETHOD NeoEsp8266UartWs2813Method //if you get an error here, try to change to NeoEsp8266Uart1Ws2813Method or use Neopixelbus v2.3.5
#elif LEDPIN == 3
#define PIXELMETHOD NeoEsp8266Dma800KbpsMethod
#else

View File

@ -2689,7 +2689,7 @@ uint16_t WS2812FX::mode_meteor_smooth() {
// fade all leds to colors[1] in LEDs one step
for (uint16_t i = SEGMENT.start; i <= SEGMENT.stop; i++) {
if (_locked[i] != IS_PART_OF_METEOR && _locked[i] != 0 && random8() <= decayProb)
if (_locked[i] != 0 && random8() <= decayProb)
{
int change = 3 - random8(12); //change each time between -8 and +3
_locked[i] += change;
@ -2705,11 +2705,8 @@ uint16_t WS2812FX::mode_meteor_smooth() {
if(in + j > SEGMENT.stop) {
index = SEGMENT.start + (in + j - SEGMENT.stop) -1;
}
_locked[index] = IS_PART_OF_METEOR;
setPixelColor(index, color_blend(getPixelColor(index), color_from_palette(240, false, true, 255), 48));
if (j == 0) _locked[index] = 240;//last pixel of meteor
_locked[index] = 240;
}
SEGMENT_RUNTIME.counter_mode_step += SEGMENT.speed +1;

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -440,7 +440,7 @@ Enable ArduinoOTA: <input type="checkbox" name="AO"><br>
<a href="https://github.com/Aircoookie/WLED" target="_blank">WLED</a> version 0.8.3<br><br>
<a href="https://github.com/Aircoookie/WLED/wiki/Contributors-&-About" target="_blank">Contributors, dependencies and special thanks</a><br>
A huge thank you to everyone who helped me create WLED!<br><br>
(c) 2016-2018 Christian Schwinne <br>
(c) 2016-2019 Christian Schwinne <br>
<i>Licensed under the MIT license</i><br><br>
Server message: <span class="msg"> Response error! </span><hr>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button>

View File

@ -37,7 +37,7 @@
#else
#ifdef ARDUINO_ARCH_ESP32
#include <WiFi.h>
#include <WebServer.h> //if you get an error here please update to ESP32 arduino core 1.0.0
#include "../webserver/WebServer.h" //> //if you get an error here please update to ESP32 arduino core 1.0.0
#else
#include <ESP8266WebServer.h>
#include <ESP8266WiFi.h>

View File

@ -78,7 +78,7 @@
//version code in format yymmddb (b = daily build)
#define VERSION 1901091
#define VERSION 1901181
char versionString[] = "0.8.3-dev";

View File

@ -16,6 +16,12 @@ void XML_response(bool isHTTP, bool includeTheme)
oappendi(col[i]);
oappend("</cl>");
}
for (int i = 0; i < 3; i++)
{
oappend("<cs>");
oappendi(colSec[i]);
oappend("</cs>");
}
oappend("<ns>");
oappendi(notifyDirect);
@ -43,7 +49,9 @@ void XML_response(bool isHTTP, bool includeTheme)
} else {
oappend("-1");
}
oappend("</wv><md>");
oappend("</wv><ws>");
oappendi(whiteSec);
oappend("</ws><md>");
oappendi(useHSB);
oappend("</md><ds>");
oappend(serverDescription);

View File

@ -170,6 +170,14 @@ void initServer()
DEBUG_PRINTLN("URI: " + server.uri());
DEBUG_PRINTLN("Body: " + server.arg(0));
//make API CORS compatible
if (server.method() == HTTP_OPTIONS)
{
server.sendHeader("Access-Control-Allow-Origin", "*");
server.send(204);
return;
}
//workaround for subpage issue
if (server.uri().length() == 1)
{