mirror of
https://github.com/wled/WLED.git
synced 2025-07-14 14:26:33 +00:00
Playlist bugfix.
This commit is contained in:
parent
bbf46358fa
commit
31bf615fe8
@ -239,7 +239,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
JsonObject udpn = root["udpn"];
|
JsonObject udpn = root["udpn"];
|
||||||
notifyDirect = udpn["send"] | notifyDirect;
|
notifyDirect = udpn["send"] | notifyDirect;
|
||||||
receiveNotifications = udpn["recv"] | receiveNotifications;
|
receiveNotifications = udpn["recv"] | receiveNotifications;
|
||||||
bool noNotification = udpn[F("nn")]; //send no notification just for this request
|
if ((bool)udpn[F("nn")]) callMode = CALL_MODE_NO_NOTIFY; //send no notification just for this request
|
||||||
|
|
||||||
unsigned long timein = root[F("time")] | UINT32_MAX; //backup time source if NTP not synced
|
unsigned long timein = root[F("time")] | UINT32_MAX; //backup time source if NTP not synced
|
||||||
if (timein != UINT32_MAX) {
|
if (timein != UINT32_MAX) {
|
||||||
@ -339,12 +339,13 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
JsonObject playlist = root[F("playlist")];
|
JsonObject playlist = root[F("playlist")];
|
||||||
if (!playlist.isNull() && loadPlaylist(playlist, presetId)) {
|
if (!playlist.isNull() && loadPlaylist(playlist, presetId)) {
|
||||||
//do not notify here, because the first playlist entry will do
|
//do not notify here, because the first playlist entry will do
|
||||||
noNotification = true;
|
if (root["on"].isNull()) callMode = CALL_MODE_NO_NOTIFY;
|
||||||
|
else callMode = CALL_MODE_DIRECT_CHANGE; // possible bugfix for playlist only containing HTTP API preset FX=~
|
||||||
} else {
|
} else {
|
||||||
interfaceUpdateCallMode = CALL_MODE_WS_SEND;
|
interfaceUpdateCallMode = CALL_MODE_WS_SEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
colorUpdated(noNotification ? CALL_MODE_NO_NOTIFY : callMode);
|
colorUpdated(callMode);
|
||||||
|
|
||||||
return stateResponse;
|
return stateResponse;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ void toggleOnOff()
|
|||||||
{
|
{
|
||||||
briLast = bri;
|
briLast = bri;
|
||||||
bri = 0;
|
bri = 0;
|
||||||
unloadPlaylist();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +37,7 @@ void toggleOnOff()
|
|||||||
//scales the brightness with the briMultiplier factor
|
//scales the brightness with the briMultiplier factor
|
||||||
byte scaledBri(byte in)
|
byte scaledBri(byte in)
|
||||||
{
|
{
|
||||||
uint32_t d = in*briMultiplier;
|
uint16_t val = ((uint16_t)in*briMultiplier)/100;
|
||||||
uint32_t val = d/100;
|
|
||||||
if (val > 255) val = 255;
|
if (val > 255) val = 255;
|
||||||
return (byte)val;
|
return (byte)val;
|
||||||
}
|
}
|
||||||
|
@ -514,10 +514,11 @@ bool updateVal(const String* req, const char* key, byte* val, byte minv, byte ma
|
|||||||
int out = getNumVal(req, pos+1);
|
int out = getNumVal(req, pos+1);
|
||||||
if (out == 0)
|
if (out == 0)
|
||||||
{
|
{
|
||||||
|
// we only have ~ (and perhaps -)
|
||||||
if (req->charAt(pos+4) == '-') {
|
if (req->charAt(pos+4) == '-') {
|
||||||
*val = min((int)maxv, max((int)minv, (int)(*val -1)));
|
*val = (int)(*val -1) < (int)minv ? maxv : (*val -1);
|
||||||
} else {
|
} else {
|
||||||
*val = min((int)maxv, max((int)minv, (int)(*val +1)));
|
*val = (int)(*val +1) > (int)maxv ? minv : (*val +1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
out += *val;
|
out += *val;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user