Added blynk UI updates

This commit is contained in:
cschwinne 2018-07-29 14:03:02 +02:00
parent b3dcb9fe6c
commit 1c3878fcb0
5 changed files with 23 additions and 7 deletions

View File

@ -2,11 +2,12 @@
WLED is a fast and (relatively) secure implementation of an ESP8266/ESP32 webserver to control NeoPixel (WS2812B) LEDs!
### Features: (V0.7.0)
### Features: (V0.7.1)
- RGB, HSB, and brightness sliders
- All new, mobile-friendly web UI!
- Settings page - configuration over network
- Access Point and station mode - automatic failsafe AP
- Support of Blynk IoT cloud
- WS2812FX library integrated for over 50 special effects (+Custom Theater Chase)!
- Secondary color support lets you use even more effect combinations
- Alexa smart home device server (including dimming)

View File

@ -38,7 +38,7 @@
#include "src/dependencies/blynk/BlynkSimpleEsp.h"
//version in format yymmddb (b = daily build)
#define VERSION 1807221
#define VERSION 1807291
char versionString[] = "0.7.1";
//AP and OTA default passwords (change them!)

View File

@ -16,6 +16,7 @@ void notify(byte callMode, bool followUp=false)
case 6: if (!notifyDirect) return; break; //fx change
case 7: if (!notifyHue) return; break;
case 8: if (!notifyDirect) return; break;
case 9: if (!notifyDirect) return; break;
default: return;
}
byte udpOut[WLEDPACKETSIZE];

View File

@ -67,7 +67,7 @@ bool colorChanged()
void colorUpdated(int callMode)
{
//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (NN)6: fx changed 7: hue 8: preset cycle
//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (NN)6: fx changed 7: hue 8: preset cycle 9: blynk
if (!colorChanged())
{
if (callMode == 6) notify(6);
@ -117,6 +117,7 @@ void colorUpdated(int callMode)
setLedsStandard();
strip.trigger();
}
if (callMode != 9 && callMode != 5 && callMode != 8) updateBlynk();
}
void handleTransitions()
@ -194,6 +195,7 @@ void handleNightlight()
bri = nightlightTargetBri;
colorUpdated(5);
}
updateBlynk();
if (bri == 0) briLast = briNlT;
}
} else if (nightlightActiveOld) //early de-init

View File

@ -18,24 +18,36 @@ void handleBlynk()
Blynk.run();
}
void updateBlynk()
{
Blynk.virtualWrite(V0,bri);
//we need a RGB -> HSB convert here
Blynk.virtualWrite(V3,bri);
Blynk.virtualWrite(V4,effectCurrent);
Blynk.virtualWrite(V5,effectSpeed);
Blynk.virtualWrite(V6,effectIntensity);
Blynk.virtualWrite(V7,nightlightActive);
Blynk.virtualWrite(V8,notifyDirect);
}
BLYNK_WRITE(V0)
{
bri = param.asInt();//bri
colorUpdated(1);
colorUpdated(9);
}
BLYNK_WRITE(V1)
{
blHue = param.asInt();//hue
colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(1);
colorUpdated(9);
}
BLYNK_WRITE(V2)
{
blSat = param.asInt();//sat
colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(1);
colorUpdated(9);
}
BLYNK_WRITE(V3)
@ -46,7 +58,7 @@ BLYNK_WRITE(V3)
BLYNK_WRITE(V4)
{
effectCurrent = param.asInt()-1;//fx
colorUpdated(6);
colorUpdated(9);
}
BLYNK_WRITE(V5)