diff --git a/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy b/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy index e3dda08..250eb58 100644 --- a/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy +++ b/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy @@ -823,8 +823,8 @@ def deviceHandler(evt) { } def sendToHarmony(evt, String callbackUrl) { - def callback = new URI(callbackUrl) - if(isIP(callback.host)){ + def callback = new URI(callbackUrl) + if (callback.port != -1) { def host = callback.port != -1 ? "${callback.host}:${callback.port}" : callback.host def path = callback.query ? "${callback.path}?${callback.query}".toString() : callback.path sendHubCommand(new physicalgraph.device.HubAction( @@ -852,25 +852,6 @@ def sendToHarmony(evt, String callbackUrl) { } } -public static boolean isIP(String str) { - try { - String[] parts = str.split("\\."); - if (parts.length != 4) return false; - for (int i = 0; i < 4; ++i) { - int p - try { - p = Integer.parseInt(parts[i]); - } catch (Exception e) { - return false; - } - if (p > 255 || p < 0) return false; - } - return true; - } catch (Exception e) { - return false; - } -} - def listHubs() { location.hubs?.findAll { it.type.toString() == "PHYSICAL" }?.collect { hubItem(it) } }