mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
WLED - Fix empty segment element in DB
This commit is contained in:
parent
a57bcbc2b8
commit
d82a90bf65
@ -2379,23 +2379,29 @@ function updateElementsWled(ledType, key) {
|
|||||||
} else {
|
} else {
|
||||||
//If failed to get properties
|
//If failed to get properties
|
||||||
var hardwareLedCount;
|
var hardwareLedCount;
|
||||||
|
var segmentConfig = false;
|
||||||
|
|
||||||
if (configuredDeviceType == ledType && configuredHost == host) {
|
if (configuredDeviceType == ledType && configuredHost == host) {
|
||||||
// Populate elements from existing configuration
|
// Populate elements from existing configuration
|
||||||
|
if (window.serverConfig.device.segments) {
|
||||||
|
segmentConfig = true;
|
||||||
|
}
|
||||||
|
hardwareLedCount = window.serverConfig.device.hardwareLedCount;
|
||||||
|
} else {
|
||||||
|
// Populate elements with default values
|
||||||
|
hardwareLedCount = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (segmentConfig) {
|
||||||
var configuredstreamSegmentId = window.serverConfig.device.segments.streamSegmentId.toString();
|
var configuredstreamSegmentId = window.serverConfig.device.segments.streamSegmentId.toString();
|
||||||
enumSegSelectVals = [configuredstreamSegmentId];
|
enumSegSelectVals = [configuredstreamSegmentId];
|
||||||
enumSegSelectTitleVals = ["Segment " + configuredstreamSegmentId];
|
enumSegSelectTitleVals = ["Segment " + configuredstreamSegmentId];
|
||||||
enumSegSelectDefaultVal = configuredstreamSegmentId;
|
enumSegSelectDefaultVal = configuredstreamSegmentId;
|
||||||
|
|
||||||
hardwareLedCount = window.serverConfig.device.hardwareLedCount;
|
|
||||||
} else {
|
} else {
|
||||||
// Populate elements with default values
|
|
||||||
defaultSegmentId = "-1";
|
defaultSegmentId = "-1";
|
||||||
enumSegSelectVals.push(defaultSegmentId);
|
enumSegSelectVals.push(defaultSegmentId);
|
||||||
enumSegSelectTitleVals.push($.i18n('edt_dev_spec_segments_disabled_title'));
|
enumSegSelectTitleVals.push($.i18n('edt_dev_spec_segments_disabled_title'));
|
||||||
enumSegSelectDefaultVal = defaultSegmentId;
|
enumSegSelectDefaultVal = defaultSegmentId;
|
||||||
|
|
||||||
hardwareLedCount = 1;
|
|
||||||
}
|
}
|
||||||
conf_editor.getEditor("root.generalOptions.hardwareLedCount").setValue(hardwareLedCount);
|
conf_editor.getEditor("root.generalOptions.hardwareLedCount").setValue(hardwareLedCount);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user