Skip to content

Commit

Permalink
[tr064] log warning if config invalid (openhab#9529)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored and thinkingstone committed Nov 7, 2021
1 parent ff2b73d commit 335e720
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.openhab.binding.tr064.internal.config;

import java.util.Collections;
import java.util.List;

import org.eclipse.jdt.annotation.NonNullByDefault;
Expand All @@ -27,7 +26,7 @@ public class Tr064SubConfiguration extends Tr064BaseThingConfiguration {
public String uuid = "";

// Lan Device
public List<String> macOnline = Collections.emptyList();
public List<String> macOnline = List.of();

public boolean isValid() {
return !uuid.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,15 @@ private static Set<String> getAndCheckParameters(String channelId, ActionType ac
// validate parameter against pattern
String parameterPattern = parameter.getPattern();
if (parameterPattern != null) {
parameters.removeIf(param -> !param.matches(parameterPattern));
parameters.removeIf(param -> {
if (!param.matches(parameterPattern)) {
LOGGER.warn("Removing {} while processing {}, does not match pattern {}, check config.", param,
channelId, parameterPattern);
return true;
} else {
return false;
}
});
}

// validate parameter against SCPD (if not internal only)
Expand Down

0 comments on commit 335e720

Please sign in to comment.