From baaa825dcfb5a608cba852ed90c667fef6588148 Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Thu, 6 Jul 2017 12:28:22 -0700 Subject: [PATCH] removes console discovery, fixes #62 Signed-off-by: Dan Cunningham --- .../discovery/OmnilinkDiscoveryService.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/addons/binding/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/discovery/OmnilinkDiscoveryService.java b/addons/binding/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/discovery/OmnilinkDiscoveryService.java index 565de743630f6..1a4ac42a47a0d 100644 --- a/addons/binding/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/discovery/OmnilinkDiscoveryService.java +++ b/addons/binding/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/discovery/OmnilinkDiscoveryService.java @@ -26,7 +26,6 @@ import com.digitaldan.jomnilinkII.MessageTypes.properties.AreaProperties; import com.digitaldan.jomnilinkII.MessageTypes.properties.AudioZoneProperties; import com.digitaldan.jomnilinkII.MessageTypes.properties.ButtonProperties; -import com.digitaldan.jomnilinkII.MessageTypes.properties.ConsoleProperties; import com.digitaldan.jomnilinkII.MessageTypes.properties.ThermostatProperties; import com.digitaldan.jomnilinkII.MessageTypes.properties.UnitProperties; import com.digitaldan.jomnilinkII.MessageTypes.properties.ZoneProperties; @@ -72,8 +71,6 @@ protected void startScan() { discoverButtons(); discoverThermostats(); discoverAudioZones(); - // generate consoles is throwing and error - // generateConsoles(); } catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) { logger.debug("Received error during discovery", e); } @@ -118,32 +115,6 @@ private void discoverButtons() } } - private void generateConsoles() - throws OmniInvalidResponseException, OmniUnknownMessageTypeException, BridgeOfflineException { - - for (AreaProperties areaProperties : areas) { - int areaFilter = bitFilterForArea(areaProperties); - - ObjectPropertyRequest objectPropertyRequest = ObjectPropertyRequest - .builder(bridgeHandler, ObjectPropertyRequests.CONSOLE).areaFilter(areaFilter).build(); - - for (ConsoleProperties consoleProperties : objectPropertyRequest) { - - int objnum = consoleProperties.getNumber(); - Map properties = new HashMap<>(); - ThingUID thingUID = new ThingUID(OmnilinkBindingConstants.THING_TYPE_CONSOLE, - bridgeHandler.getThing().getUID(), Integer.toString(objnum)); - properties.put(OmnilinkBindingConstants.THING_PROPERTIES_NUMBER, objnum); - properties.put(OmnilinkBindingConstants.THING_PROPERTIES_AREA, areaProperties.getNumber()); - - DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) - .withBridge(this.bridgeHandler.getThing().getUID()).withLabel(consoleProperties.getName()) - .build(); - thingDiscovered(discoveryResult); - } - } - } - private void discoverAudioZones() throws OmniInvalidResponseException, OmniUnknownMessageTypeException, BridgeOfflineException {