mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -755,7 +755,7 @@ $(document).ready(function () {
|
||||
updateJsonEditorSelection(conf_editor_video, 'root.grabberV4L2',
|
||||
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, addSelect, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
async function discoverInputSources(type, params) {
|
||||
const result = await requestInputSourcesDiscovery(type, params);
|
||||
|
@@ -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:
|
||||
}
|
||||
|
||||
|
@@ -4,10 +4,11 @@ var isScroll = true;
|
||||
|
||||
performTranslation();
|
||||
requestLoggingStop();
|
||||
requestLoggingStart();
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
requestLoggingStart();
|
||||
|
||||
$('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit'));
|
||||
if (window.showOptHelp) {
|
||||
$('#conf_cont').append(createHelpTable(window.schema.logger.properties, $.i18n("edt_conf_log_heading_title")));
|
||||
|
@@ -110,8 +110,16 @@ function loadContent(event, forceRefresh) {
|
||||
$("#page-content").off();
|
||||
$("#page-content").load("/content/" + tag + ".html", function (response, status, xhr) {
|
||||
if (status == "error") {
|
||||
$("#page-content").html('<h3>' + $.i18n('info_404') + '</h3>');
|
||||
removeOverlay();
|
||||
tag = 'dashboard';
|
||||
console.log("Could not find page:", prevTag, ", Redirecting to:", tag);
|
||||
setStorage('lasthashtag', tag, true);
|
||||
|
||||
$("#page-content").load("/content/" + tag + ".html", function (response, status, xhr) {
|
||||
if (status == "error") {
|
||||
$("#page-content").html('<h3>' + encode_utf8(tag) + '<br/>' + $.i18n('info_404') + '</h3>');
|
||||
removeOverlay();
|
||||
}
|
||||
});
|
||||
}
|
||||
updateUiOnInstance(window.currentHyperionInstance);
|
||||
});
|
||||
@@ -710,7 +718,11 @@ function hexToRgb(hex) {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null;
|
||||
} : {
|
||||
r: 0,
|
||||
g: 0,
|
||||
b: 0
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1135,6 +1147,7 @@ function getSystemInfo() {
|
||||
info += '- UI Access: ' + storedAccess + '\n';
|
||||
//info += '- Log lvl: ' + window.serverConfig.logger.level + '\n';
|
||||
info += '- Avail Capt: ' + window.serverInfo.grabbers.available + '\n';
|
||||
info += '- Config path: ' + shy.rootPath + '\n';
|
||||
info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
|
||||
|
||||
info += '\n';
|
||||
@@ -1153,6 +1166,7 @@ function getSystemInfo() {
|
||||
info += '- CPU Hardware: ' + sys.cpuHardware + '\n';
|
||||
|
||||
info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
|
||||
info += '- Root/Admin: ' + sys.isUserAdmin + '\n';
|
||||
info += '- Qt Version: ' + sys.qtVersion + '\n';
|
||||
info += '- Python Version: ' + sys.pyVersion + '\n';
|
||||
info += '- Browser: ' + navigator.userAgent;
|
||||
|
Reference in New Issue
Block a user