pull/337/head
cschwinne 2019-10-26 00:00:44 +02:00
rodzic 0cd46f932a
commit ba1117e10e
12 zmienionych plików z 26 dodań i 13 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
<html>
<head><meta charset="utf-8"><meta name="theme-color" content="#fff">
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
<title>WLED 0.8.5</title>
<title>WLED 0.8.6</title>
<script>
var d=document;
var w=window.getComputedStyle(d.querySelector("html"));

Wyświetl plik

@ -7,7 +7,7 @@
<meta name="theme-color" content="#333333">
<meta content="yes" name="apple-mobile-web-app-capable">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAGACGAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAE1JREFUOI1j/P//PwOxgNGeAUMxE9G6cQCKDWAhpADZ2f8PMjBS3QW08QK20KaZC2gfC9hCnqouoNgARgY7zMxAyNlUdQHlXiAlO2MDAD63EVqNHAe0AAAAAElFTkSuQmCC"/>
<title>WLED 0.8.5</title>
<title>WLED 0.8.6</title>
<script>function feedback(){}</script>
<style>
*{transition-duration: 0.5s;}

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -85,7 +85,7 @@ el.innerHTML=x;el.selectedIndex=pl?p:f;}).catch(function(){el.innerHTML=e;})}fun
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
<h2>LED setup</h2>
LED count: <input name="LC" type="number" min="1" max="1200" oninput=UI() required><br>
LED count: <input name="LC" type="number" min="1" max="1500" oninput=UI() required><br>
<i>Recommended power supply for brightest white:</i><br>
<b><span id="psu">?</span></b><br><br>
Maximum Current: <input name="MA" type="number" min="250" max="65000" required> mA<br>

Wyświetl plik

@ -30,7 +30,7 @@
//#define WLED_ENABLE_FS_EDITOR //enable /edit page for editing SPIFFS content. Will also be disabled with OTA lock
//to toggle usb serial debug (un)comment the following line
#define WLED_DEBUG
//#define WLED_DEBUG
//library inclusions
@ -100,7 +100,7 @@
//version code in format yymmddb (b = daily build)
#define VERSION 1910253
#define VERSION 1910255
char versionString[] = "0.8.6";
@ -263,6 +263,7 @@ bool apActive = false;
bool forceReconnect = false;
uint32_t lastReconnectAttempt = 0;
bool interfacesInited = false;
bool wasConnected = false;
//color
byte col[]{255, 159, 0, 0}; //target RGB(W) color
@ -411,6 +412,9 @@ IPAddress ntpServerIP;
unsigned int ntpLocalPort = 2390;
#define NTP_PACKET_SIZE 48
#define MAX_LEDS 1500
#define MAX_LEDS_DMA 500
//string temp buffer (now stored in stack locally)
#define OMAX 2048
char* obuf;

Wyświetl plik

@ -298,7 +298,7 @@ void loadSettingsFromEEPROM(bool first)
if (apChannel > 13 || apChannel < 1) apChannel = 1;
apHide = EEPROM.read(228);
if (apHide > 1) apHide = 1;
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00); if (ledCount > 1200 || ledCount == 0) ledCount = 30;
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00); if (ledCount > MAX_LEDS || ledCount == 0) ledCount = 30;
notifyButton = EEPROM.read(230);
notifyTwice = EEPROM.read(231);

Wyświetl plik

@ -55,10 +55,10 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (subPage == 2)
{
int t = request->arg("LC").toInt();
if (t > 0 && t <= 1200) ledCount = t;
if (t > 0 && t <= MAX_LEDS) ledCount = t;
#ifndef ARDUINO_ARCH_ESP32
#if LEDPIN == 3
if (ledCount > 300) ledCount = 300; //DMA method uses too much ram
if (ledCount > MAX_LEDS_DMA) ledCount = MAX_LEDS_DMA; //DMA method uses too much ram
#endif
#endif
strip.ablMilliampsMax = request->arg("MA").toInt();

Wyświetl plik

@ -6,10 +6,10 @@ void wledInit()
{
EEPROM.begin(EEPSIZE);
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00);
if (ledCount > 1200 || ledCount == 0) ledCount = 30;
if (ledCount > MAX_LEDS || ledCount == 0) ledCount = 30;
#ifndef ARDUINO_ARCH_ESP32
#if LEDPIN == 3
if (ledCount > 300) ledCount = 300; //DMA method uses too much ram
if (ledCount > MAX_LEDS_DMA) ledCount = MAX_LEDS_DMA; //DMA method uses too much ram
#endif
#endif
Serial.begin(115200);
@ -233,6 +233,7 @@ void initInterfaces() {
reconnectHue();
initMqtt();
interfacesInited = true;
wasConnected = true;
}
byte stacO = 0;
@ -262,6 +263,7 @@ void handleConnection() {
initConnection();
interfacesInited = false;
forceReconnect = false;
wasConnected = false;
return;
}
if (!WLED_CONNECTED) {
@ -271,7 +273,7 @@ void handleConnection() {
initConnection();
}
if (millis() - lastReconnectAttempt > 300000 && WLED_WIFI_CONFIGURED) initConnection();
if (!apActive && millis() - lastReconnectAttempt > 12000) initAP();
if (!apActive && millis() - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == 1)) initAP();
} else if (!interfacesInited) { //newly connected
DEBUG_PRINTLN("");
DEBUG_PRINT("Connected! IP address: ");

Wyświetl plik

@ -174,6 +174,9 @@ void handleNotifications()
//wled notifier, block if realtime packets active
if (udpIn[0] == 0 && !realtimeActive && receiveNotifications)
{
//ignore notification if received within a second after sending a notification ourselves
if (millis() - notificationSentTime < 1000) return;
bool someSel = (receiveNotificationBrightness || receiveNotificationColor || receiveNotificationEffects);
//apply colors from notification
if (receiveNotificationColor || !someSel)

Wyświetl plik

@ -98,12 +98,12 @@ void publishMqtt()
const char HA_static_JSON[] PROGMEM = R"=====(,"bri_val_tpl":"{{value}}","rgb_cmd_tpl":"{{'#%02x%02x%02x' | format(red, green, blue)}}","rgb_val_tpl":"{{value[1:3]|int(base=16)}},{{value[3:5]|int(base=16)}},{{value[5:7]|int(base=16)}}","qos":0,"opt":true,"pl_on":"ON","pl_off":"OFF","fx_val_tpl":"{{value}}","fx_list":[)=====";
char buffer[2400]; //TODO: this is a TERRIBLE waste of precious memory, local var leads to exception though. Maybe dynamic allocation, but it is unclear when to free
char* buffer;
void sendHADiscoveryMQTT()
{
#if ARDUINO_ARCH_ESP32 || LEDPIN != 3
#if ARDUINO_ARCH_ESP32 || LWIP_VERSION_MAJOR > 1
/*
YYYY is device topic
@ -139,6 +139,8 @@ Send out HA MQTT Discovery message on MQTT connect (~2.4kB):
*/
doSendHADiscovery = false;
if (mqtt == nullptr || !mqtt->connected()) return;
buffer = new char[2400];
if (!buffer) {delete[] buffer; return;}
char bufc[36], bufcol[38], bufg[36], bufapi[38];
@ -214,6 +216,8 @@ Send out HA MQTT Discovery message on MQTT connect (~2.4kB):
strcat(pubt, "/config");
bool success = mqtt->publish(pubt, 0, true, buffer);
DEBUG_PRINTLN(success);
yield();
delete[] buffer;
#endif
}