Implement ftdi led device

This commit is contained in:
LordGrey
2023-03-25 23:32:14 +00:00
parent 2f09f9a0b8
commit f0259172fd
18 changed files with 962 additions and 4 deletions

View File

@@ -158,6 +158,7 @@
"conf_leds_optgroup_network": "Network",
"conf_leds_optgroup_other": "Other",
"conf_leds_optgroup_usb": "USB/Serial",
"conf_leds_optgroup_ftdi": "USB/Ftdi",
"conf_logging_btn_autoscroll": "Auto scrolling",
"conf_logging_btn_clipboard": "Copy Log to Clipboard",
"conf_logging_btn_pbupload": "Upload a report for support requests",
@@ -567,6 +568,11 @@
"edt_dev_enum_sub_min_cool_adjust": "Subtract cool white",
"edt_dev_enum_sub_min_warm_adjust": "Subtract warm white",
"edt_dev_enum_subtract_minimum": "Subtract minimum",
"edt_dev_enum_hyperserial_cold_white": "Hyperserial, cold white",
"edt_dev_enum_hyperserial_neutral_white": "Hyperserial, neutral white",
"edt_dev_enum_wled_auto": "Wled auto",
"edt_dev_enum_wled_auto_max": "Wled auto max",
"edt_dev_enum_wled_auto_accurate": "Wled auto accurate",
"edt_dev_enum_white_off": "White off",
"edt_dev_general_autostart_title": "Autostart",
"edt_dev_general_autostart_title_info": "The LED device is switched-on during startup or not",

View File

@@ -1645,8 +1645,10 @@ $(document).ready(function () {
optArr[3] = [];
optArr[4] = [];
optArr[5] = [];
optArr[6] = [];
for (var idx = 0; idx < ledDevices.length; idx++) {
var isFtdi = ledDevices[idx].endsWith("_ftdi");
if ($.inArray(ledDevices[idx], devRPiSPI) != -1)
optArr[0].push(ledDevices[idx]);
else if ($.inArray(ledDevices[idx], devRPiPWM) != -1)
@@ -1659,8 +1661,10 @@ $(document).ready(function () {
optArr[4].push(ledDevices[idx]);
else if ($.inArray(ledDevices[idx], devHID) != -1)
optArr[4].push(ledDevices[idx]);
else
else if (isFtdi)
optArr[5].push(ledDevices[idx]);
else
optArr[6].push(ledDevices[idx]);
}
$("#leddevices").append(createSel(optArr[0], $.i18n('conf_leds_optgroup_RPiSPI')));
@@ -1668,9 +1672,10 @@ $(document).ready(function () {
$("#leddevices").append(createSel(optArr[2], $.i18n('conf_leds_optgroup_RPiGPIO')));
$("#leddevices").append(createSel(optArr[3], $.i18n('conf_leds_optgroup_network')));
$("#leddevices").append(createSel(optArr[4], $.i18n('conf_leds_optgroup_usb')));
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_ftdi')));
if (storedAccess === 'expert' || window.serverConfig.device.type === "file") {
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_other')));
$("#leddevices").append(createSel(optArr[6], $.i18n('conf_leds_optgroup_other')));
}
$("#leddevices").val(window.serverConfig.device.type);