Fix for narrrowbandEq mode start condition failure

And add test
As discussed https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371
This commit is contained in:
Dave Conway-Jones
2022-01-11 13:56:44 +00:00
parent 062f76214e
commit 52e4e0e569
2 changed files with 3 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ module.exports = function(RED) {
else {
var n = parseFloat(value);
if (!isNaN(n)) {
if ((typeof node.previous[t] === 'undefined') && (this.func === "narrowband")) {
if ((typeof node.previous[t] === 'undefined') && (this.func === "narrowband" || this.func === "narrowbandEq")) {
if (node.start === '') { node.previous[t] = n; }
else { node.previous[t] = node.start; }
}