Skip to content

Commit

Permalink
Accept hex color strings in individual LED API
Browse files Browse the repository at this point in the history
Version bump to 0.13.0-b2 "Toki"
Fixed transition property not applying unless power/bri/color changed next
Moved transition field below segments (temporarily)
  • Loading branch information
Aircoookie committed Jul 10, 2021
1 parent 0862859 commit 6a8ed11
Show file tree
Hide file tree
Showing 12 changed files with 2,221 additions and 2,211 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "0.13.0-b1",
"version": "0.13.0-b2",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion pio-scripts/output_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def bin_rename_copy(source, target, env):

release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME")

if release_name and os.getenv("WLED_RELEASE"):
if release_name:
_create_dirs(["release"])
version = _get_cpp_define_value(env, "WLED_VERSION")
release_file = "{}release{}WLED_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name)
Expand Down
2 changes: 1 addition & 1 deletion wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
JsonObject if_sync_recv = if_sync["recv"];
CJSON(receiveNotificationBrightness, if_sync_recv["bri"]);
CJSON(receiveNotificationColor, if_sync_recv["col"]);
CJSON(receiveNotificationEffects, if_sync_recv[F("fx")]);
CJSON(receiveNotificationEffects, if_sync_recv["fx"]);
//! following line might be a problem if called after boot
receiveNotifications = (receiveNotificationBrightness || receiveNotificationColor || receiveNotificationEffects);

Expand Down
8 changes: 5 additions & 3 deletions wled00/data/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ input[type=range]:active + .sliderbubble {
margin-top: 5px;
display: none;
}
#tt {
text-align: center;
}

.cl {
width: 42px;
Expand Down Expand Up @@ -653,7 +656,7 @@ input[type=number], input[type=text] {
background: var(--c-3);
color: var(--c-f);
border: 0px solid white;
border-radius: 5px;
border-radius: 25px;
padding: 8px;
margin: 6px 6px 6px 0;
font-size: 19px;
Expand Down Expand Up @@ -683,7 +686,6 @@ textarea {

input[type=text] {
width: 100px;
border-radius: 25px;
text-align: center;
}

Expand All @@ -706,7 +708,6 @@ input[type=number]::-webkit-outer-spin-button {
}

.pln {
border-radius: 25px !important;
width: 67px !important;
margin: 0 2px 8px 0 !important;
text-align: center;
Expand All @@ -723,6 +724,7 @@ input[type=number]::-webkit-outer-spin-button {
}

.segn {
border-radius: 5px !important;
margin: 3px 0 6px 0 !important;
}

Expand Down
4 changes: 2 additions & 2 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<div id="segutil2">
<button class="btn btn-s" id="rsbtn" onclick="rSegs()">Reset segments</button>
</div>
<p>Transition: <input id="tt" class="noslide" type="number" min="0" max="65.5" step="0.1" value="0.7">s</p>
</div>

<div id="Favorites" class="tabcontent">
Expand All @@ -164,8 +165,7 @@
</div>
<div id="pcont">
Loading...
</div><br>
Transition <input id="tt" class="noslide" type="number" min="0" max="65.5" step="0.1" value="0.7">s
</div>
</div>
</div>

Expand Down
8 changes: 5 additions & 3 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ function requestJson(command, rinfo = true) {
{
command.v = true; //get complete API response
command.time = Math.floor(Date.now() / 1000);
var t = d.getElementById('tt');
if (t.validity.valid) {
var tn = parseInt(t.value*10);
if (tn != tr) command.transition = tn;
}
req = JSON.stringify(command);
if (req.length > 1000) useWs = false; //do not send very long requests over websocket
}
Expand Down Expand Up @@ -1156,7 +1161,6 @@ function requestJson(command, rinfo = true) {
function togglePower() {
isOn = !isOn;
var obj = {"on": isOn};
obj.transition = parseInt(d.getElementById('tt').value*10);
requestJson(obj);
}

Expand Down Expand Up @@ -1543,7 +1547,6 @@ function setPalette(paletteId = null)

function setBri() {
var obj = {"bri": parseInt(d.getElementById('sliderBri').value)};
obj.transition = parseInt(d.getElementById('tt').value*10);
requestJson(obj);
}

Expand Down Expand Up @@ -1756,7 +1759,6 @@ function setColor(sr) {
}
updateHex();
updateRgb();
obj.transition = parseInt(d.getElementById('tt').value*10);
requestJson(obj);
}

Expand Down
2 changes: 1 addition & 1 deletion wled00/html_other.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st
.bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}
</style></head><body><h2>WLED Software Update</h2><form method="POST"
action="/update" id="uf" enctype="multipart/form-data" onsubmit="U()">
Installed version: 0.13.0-b1<br>Download the latest binary: <a
Installed version: 0.13.0-b2<br>Download the latest binary: <a
href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square">
</a><br><input type="file" class="bt" name="update" required><br><input
Expand Down
2 changes: 1 addition & 1 deletion wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ HTTP traffic is unencrypted. An attacker in the same network can intercept form
<h3>Software Update</h3><button type="button" onclick="U()">Manual OTA Update
</button><br>Enable ArduinoOTA: <input type="checkbox" name="AO"><br><h3>About
</h3><a href="https://github.com/Aircoookie/WLED/" target="_blank">WLED</a>
version 0.13.0-b1<br><br><a
version 0.13.0-b2<br><br><a
href="https://github.com/Aircoookie/WLED/wiki/Contributors-and-credits"
target="_blank">Contributors, dependencies and special thanks</a><br>
A huge thank you to everyone who helped me create WLED!<br><br>
Expand Down
Loading

0 comments on commit 6a8ed11

Please sign in to comment.