]> git.basschouten.com Git - openhab-addons.git/commitdiff
[network] Fix NumberFormatException for ping when locale has comma as decimal separat...
authorStephan Richter <github@srsoftware.de>
Fri, 12 Apr 2024 19:49:11 +0000 (21:49 +0200)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2024 19:49:11 +0000 (21:49 +0200)
* fixing bug:
LatencyParser fails to parse ping times on systems with comma (,) set as decimal separator

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java

index 416d455edfdb0413fc6c232088eca7906712a771..bb3bffec5da63ba02db0d379527b67c177c99810 100644 (file)
@@ -55,7 +55,7 @@ public class LatencyParser {
 
         Matcher m = LATENCY_PATTERN.matcher(inputLine);
         if (m.find() && m.groupCount() == 1) {
-            return millisToDuration(Double.parseDouble(m.group(1)));
+            return millisToDuration(Double.parseDouble(m.group(1).replace(",", ".")));
         }
 
         logger.debug("Did not find a latency value");