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! 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 - RGB, HSB, and brightness sliders
- All new, mobile-friendly web UI! - All new, mobile-friendly web UI!
- Settings page - configuration over network - Settings page - configuration over network
- Access Point and station mode - automatic failsafe AP - Access Point and station mode - automatic failsafe AP
- Support of Blynk IoT cloud
- WS2812FX library integrated for over 50 special effects (+Custom Theater Chase)! - WS2812FX library integrated for over 50 special effects (+Custom Theater Chase)!
- Secondary color support lets you use even more effect combinations - Secondary color support lets you use even more effect combinations
- Alexa smart home device server (including dimming) - Alexa smart home device server (including dimming)

View File

@ -38,7 +38,7 @@
#include "src/dependencies/blynk/BlynkSimpleEsp.h" #include "src/dependencies/blynk/BlynkSimpleEsp.h"
//version in format yymmddb (b = daily build) //version in format yymmddb (b = daily build)
#define VERSION 1807221 #define VERSION 1807291
char versionString[] = "0.7.1"; char versionString[] = "0.7.1";
//AP and OTA default passwords (change them!) //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 6: if (!notifyDirect) return; break; //fx change
case 7: if (!notifyHue) return; break; case 7: if (!notifyHue) return; break;
case 8: if (!notifyDirect) return; break; case 8: if (!notifyDirect) return; break;
case 9: if (!notifyDirect) return; break;
default: return; default: return;
} }
byte udpOut[WLEDPACKETSIZE]; byte udpOut[WLEDPACKETSIZE];

View File

@ -67,7 +67,7 @@ bool colorChanged()
void colorUpdated(int callMode) 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 (!colorChanged())
{ {
if (callMode == 6) notify(6); if (callMode == 6) notify(6);
@ -117,6 +117,7 @@ void colorUpdated(int callMode)
setLedsStandard(); setLedsStandard();
strip.trigger(); strip.trigger();
} }
if (callMode != 9 && callMode != 5 && callMode != 8) updateBlynk();
} }
void handleTransitions() void handleTransitions()
@ -194,6 +195,7 @@ void handleNightlight()
bri = nightlightTargetBri; bri = nightlightTargetBri;
colorUpdated(5); colorUpdated(5);
} }
updateBlynk();
if (bri == 0) briLast = briNlT; if (bri == 0) briLast = briNlT;
} }
} else if (nightlightActiveOld) //early de-init } else if (nightlightActiveOld) //early de-init

View File

@ -18,24 +18,36 @@ void handleBlynk()
Blynk.run(); 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) BLYNK_WRITE(V0)
{ {
bri = param.asInt();//bri bri = param.asInt();//bri
colorUpdated(1); colorUpdated(9);
} }
BLYNK_WRITE(V1) BLYNK_WRITE(V1)
{ {
blHue = param.asInt();//hue blHue = param.asInt();//hue
colorHStoRGB(blHue*10,blSat,(false)? colSec:col); colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(1); colorUpdated(9);
} }
BLYNK_WRITE(V2) BLYNK_WRITE(V2)
{ {
blSat = param.asInt();//sat blSat = param.asInt();//sat
colorHStoRGB(blHue*10,blSat,(false)? colSec:col); colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(1); colorUpdated(9);
} }
BLYNK_WRITE(V3) BLYNK_WRITE(V3)
@ -46,7 +58,7 @@ BLYNK_WRITE(V3)
BLYNK_WRITE(V4) BLYNK_WRITE(V4)
{ {
effectCurrent = param.asInt()-1;//fx effectCurrent = param.asInt()-1;//fx
colorUpdated(6); colorUpdated(9);
} }
BLYNK_WRITE(V5) BLYNK_WRITE(V5)