From c9adab53a93903fce48ed57e740dfbc4789dd6cb Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 27 Apr 2016 09:08:41 -0500 Subject: [PATCH] Updated selections in device add or editor and updated loggin for upnp listener and updated the readme --- README.md | 36 ++++++++++++++----- .../HABridge/upnp/UpnpListener.java | 17 ++++----- .../resources/public/views/editdevice.html | 1 + src/main/resources/public/views/editor.html | 2 +- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 64bd312..c008a94 100644 --- a/README.md +++ b/README.md @@ -76,14 +76,34 @@ Here is the table of items to use to tell Alexa what you want to do: To do this... | Say this... --------------|------------ -Discover | “Alexa, discover my devices.” -Turn On | “Alexa, turn on the kitchen light.” -Turn Off | “Alexa, turn off the kitchen light.” -Brighten | “Alexa, brighten the kitchen light.” -Dim | “Alexa, dim the kitchen light.” -Dim | "Alexa, Dim the lights to 40%." -Set | “Alexa, set the kitchen light to 50%.” -Set | "Alexa, Set brightness to 60%." +ON Commands | + | Alexa, turn on + | Alexa, start + | Alexa, unlock + | Alexa, open + | Alexa, boot up + | Alexa, run + | Alexa, arm +OFF Commands | + | Alexa, turn off + | Alexa, stop (this one is tricky to get right) + | Alexa, stop running (also very tricky) + | Alexa, lock + | Alexa, close + | Alexa, shutdown + | Alexa, shut + | Alexa, disarm +DIM Commands | + | Alexa, brighten to + | Alexa, dim to + | Alexa, raise to + | Alexa, lower to + | Alexa, set to + | Alexa, turn up to + | Alexa, turn down to + +To see what Alexa thinks you said, you can check in the home page for your alexa. + To view or remove devices that Alexa knows about, you can use the mobile app `Menu / Settings / Connected Home` or go to http://echo.amazon.com/#cards. ## Configuration REST API Usage This section will describe the REST api available for configuration. The REST body examples are all formatted for easy reading, the actual body usage should be like this: diff --git a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java index 1a4052f..ee58632 100644 --- a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java +++ b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java @@ -46,26 +46,27 @@ public class UpnpListener { try { responseSocket = new DatagramSocket(upnpResponsePort); if(retryCount > 0) - log.error("Upnp Response Port is in use, found port: " + upnpResponsePort); - retryCount = 0; + log.info("Upnp Response Port issue, found open port: " + upnpResponsePort); portLoopControl = false; } catch(SocketException e) { if(retryCount == 0) - log.warn("Upnp Response Port is in use, starting loop to find open port for 20 tries - port is: " + upnpResponsePort); + log.warn("Upnp Response Port is in use, starting loop to find open port for 20 tries - configured port is: " + upnpResponsePort); if(retryCount >= 20) { portLoopControl = false; - log.error("Upnp Response Port is in use, could not find - last port tried: " + upnpResponsePort + " with message: " + e.getMessage()); + log.error("Upnp Response Port issue, could not find open port - last port tried: " + upnpResponsePort + " with message: " + e.getMessage()); return false; } } - retryCount++; - upnpResponsePort++; + if(portLoopControl) { + retryCount++; + upnpResponsePort++; + } } try { upnpMulticastSocket = new MulticastSocket(Configuration.UPNP_DISCOVERY_PORT); } catch(IOException e){ - log.error("Upnp Discovery Port is in use, or restricted by admin (try running with duso or admin privs): " + Configuration.UPNP_DISCOVERY_PORT + " with message: " + e.getMessage()); + log.error("Upnp Discovery Port is in use, or restricted by admin (try running with sudo or admin privs): " + Configuration.UPNP_DISCOVERY_PORT + " with message: " + e.getMessage()); return false; } @@ -73,7 +74,7 @@ public class UpnpListener { try { ifs = NetworkInterface.getNetworkInterfaces(); } catch (SocketException e) { - log.error("Could not get network interfaces for thsi machine: " + e.getMessage()); + log.error("Could not get network interfaces for this machine: " + e.getMessage()); return false; } diff --git a/src/main/resources/public/views/editdevice.html b/src/main/resources/public/views/editdevice.html index e8e5feb..5889ee0 100644 --- a/src/main/resources/public/views/editdevice.html +++ b/src/main/resources/public/views/editdevice.html @@ -52,6 +52,7 @@
- +