LED-Device updates (#1315)

* SPI Fix - Free allocated memory in case of invert

* Remove development statement

* UI updates

* Minor corrections

* Tpm2net Fix - Free allocated memory

* LGTM Finding

* Add config directory and user type to SysInfo

* WS281x - Ensure that device runs with root priviliges

* WS281x - Update DMA defauls as per rpi_ws281x recommendation

* Support Sysinfo for Qt < 5.10

* Address LGTM finding
This commit is contained in:
LordGrey
2021-09-15 10:31:56 +02:00
committed by GitHub
parent 8fb3d76b9c
commit 8a785e70c8
18 changed files with 214 additions and 53 deletions

View File

@@ -16,6 +16,8 @@ var devNET = ['atmoorb', 'cololight', 'fadecandy', 'philipshue', 'nanoleaf', 'ti
var devSerial = ['adalight', 'dmx', 'atmo', 'sedu', 'tpm2', 'karate'];
var devHID = ['hyperionusbasp', 'lightpack', 'paintpack', 'rawhid'];
var infoTextDefault = '<span>' + $.i18n("conf_leds_device_info_log") + ' </span><a href="" onclick="SwitchToMenuItem(\'MenuItemLogging\')" style="cursor:pointer">' + $.i18n("main_menu_logging_token") + '</a>';
function round(number) {
var factor = Math.pow(10, 4);
var tempNumber = number * factor;
@@ -664,6 +666,8 @@ $(document).ready(function () {
conf_editor.getEditor("root.specificOptions").setValue(values_specific);
};
$("#info_container_text").html(infoTextDefault);
// change save button state based on validation result
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit_controller').attr('disabled', true) : $('#btn_submit_controller').attr('disabled', false);
@@ -727,6 +731,7 @@ $(document).ready(function () {
case "sk9822":
case "ws2812spi":
case "piblaster":
case "ws281x":
discover_device(ledType);
hwLedCountDefault = 1;
colorOrderDefault = "rgb";
@@ -1313,6 +1318,8 @@ var updateSelectList = function (ledType, discoveryInfo) {
ledTypeGroup = "devRPiSPI";
} else if ($.inArray(ledType, devRPiGPIO) != -1) {
ledTypeGroup = "devRPiGPIO";
} else if ($.inArray(ledType, devRPiPWM) != -1) {
ledTypeGroup = "devRPiPWM";
}
switch (ledTypeGroup) {
@@ -1473,6 +1480,18 @@ var updateSelectList = function (ledType, discoveryInfo) {
}
}
break;
case "devRPiPWM":
key = ledType;
if (discoveryInfo.devices.length == 0) {
enumVals.push("NONE");
enumTitelVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
$('#btn_submit_controller').attr('disabled', true);
showAllDeviceInputOptions(key, false);
$("#info_container_text").html($.i18n("conf_leds_info_ws281x"));
}
break;
default:
}