Skip to content

Commit 0d72480

Browse files
committed
Fix building adjustment requests
1 parent e1753e5 commit 0d72480

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

assets/webconfig/js/content_remote.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ $(document).ready(function () {
8181
</div>`;
8282
$('.crtbody').append(createTableRow([title, property], false, true));
8383
createCP(`cr_${sColor[key].key}`, value, function (rgb, hex, e) {
84-
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), `[${rgb.r},${rgb.g},${rgb.b}]`);
84+
const elementName = e.target.id.substr(e.target.id.indexOf("_") + 1);
85+
requestAdjustment(elementName, [rgb.r,rgb.g,rgb.b]);
8586
});
8687
}
8788
// Handle boolean type adjustments
@@ -93,7 +94,8 @@ $(document).ready(function () {
9394
$('.crtbody').append(createTableRow([title, property], false, true));
9495

9596
$('#cr_' + sColor[key].key).off().on('change', function (e) {
96-
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked);
97+
const elementName = e.target.id.substr(e.target.id.indexOf("_") + 1);
98+
requestAdjustment(elementName, e.currentTarget.checked);
9799
});
98100
}
99101
// Handle number type adjustments
@@ -110,8 +112,9 @@ $(document).ready(function () {
110112

111113
$('.crtbody').append(createTableRow([title, property], false, true));
112114
$('#cr_' + sColor[key].key).off().on('change', function (e) {
113-
valValue(this.id, this.value, this.min, this.max);
114-
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value);
115+
const elementName = e.target.id.substr(e.target.id.indexOf("_") + 1);
116+
const value = valValue(this.id, this.value, this.min, this.max);
117+
requestAdjustment(elementName, value);
115118
});
116119
}
117120
}

assets/webconfig/js/hyperion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ function requestAdjustment(type, value, complete) {
542542
if (complete === true)
543543
sendToHyperion("adjustment", "", { adjustment: type });
544544
else
545-
sendToHyperion("adjustment", "", { adjustment: { type: value } });
545+
sendToHyperion("adjustment", "", { adjustment: { [type]: value } });
546546
}
547547

548548
async function requestLedDeviceDiscovery(ledDeviceType, params) {

assets/webconfig/js/wizards/colorCalibrationKodiWizard.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,10 @@ const colorCalibrationKodiWizard = (() => {
431431
stop(true);
432432
});
433433

434-
wiz_editor.on("change", function (e) {
435-
const val = wiz_editor.getEditor('root.color.channelAdjustment.' + profile + '').getValue();
436-
const temp = JSON.parse(JSON.stringify(val));
437-
delete temp.leds
438-
requestAdjustment(JSON.stringify(temp), "", true);
434+
wiz_editor.on("change", function () {
435+
const { leds, ...adjustments } = wiz_editor.getEditor('root.color.channelAdjustment.' + profile).getValue();
436+
requestAdjustment(adjustments, "", true);
439437
});
440-
441438
step++
442439
performAction();
443440
}

0 commit comments

Comments
 (0)