From 9c9bbee80ae83c40a1eeb27d482722d277d471c6 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sat, 20 Dec 2025 00:26:21 +0100 Subject: [PATCH] [knx] Prevent reconfigutation of Things during device discovery Prevents reconfiguration of connection type during discovery runs. Previously, existing Things were rediscovered and reconfigured to default connection type. This comes with the drawback that all discovered devices need to be manually configured (i.e. set a proper connection type). Signed-off-by: Holger Friedrich --- .../knx/internal/discovery/KNXnetDiscoveryService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/discovery/KNXnetDiscoveryService.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/discovery/KNXnetDiscoveryService.java index ce54251caf2ed..70158d047d60f 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/discovery/KNXnetDiscoveryService.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/discovery/KNXnetDiscoveryService.java @@ -109,19 +109,19 @@ private synchronized void startDiscovery() { } if (services.containsKey(ServiceFamiliesDIB.ServiceFamily.Tunneling)) { + // .withProperty("type", "TUNNEL") was omitted to avoid reconfiguration thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_IP_BRIDGE, serial)) .withLabel(response.getDevice().getName()).withProperty("serialNumber", serial) - .withProperty("type", "TUNNEL") .withProperty("ipAddress", "" + response.getControlEndpoint().endpoint().getAddress().getHostAddress()) .withProperty("port", "" + response.getControlEndpoint().endpoint().getPort()) .withRepresentationProperty("serialNumber").build()); } if (services.containsKey(ServiceFamiliesDIB.ServiceFamily.Routing)) { + // .withProperty("type", "ROUTER") was omitted to avoid reconfiguration thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_IP_BRIDGE, serial)) .withLabel(response.getDevice().getName() + " (router mode)") - .withProperty("serialNumber", serial + "-r").withProperty("type", "ROUTER") - .withProperty("ipAddress", "224.0.23.12") + .withProperty("serialNumber", serial + "-r").withProperty("ipAddress", "224.0.23.12") .withProperty("port", "" + response.getControlEndpoint().endpoint().getPort()) .withRepresentationProperty("serialNumber").build()); }