Skip to content

Commit

Permalink
Merge pull request #56 from jlippold/master
Browse files Browse the repository at this point in the history
Adds option to disable upnp listener
  • Loading branch information
armzilla committed Jan 6, 2016
2 parents b8db4a2 + 42023a4 commit d6aebfb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/armzilla/ha/upnp/UpnpListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ public class UpnpListener {
@Value("${upnp.config.address}")
private String responseAddress;

@Value("${upnp.disable}")
private boolean disable;

@Autowired
private ApplicationContext applicationContext;

@Scheduled(fixedDelay = Integer.MAX_VALUE)
public void startListening(){

if (disable) {
return;
}

log.info("Starting UPNP Discovery Listener");

try (DatagramSocket responseSocket = new DatagramSocket(upnpResponsePort);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
upnp.response.port=50000
server.port=8080
upnp.config.address=192.168.1.1
upnp.disable=false

0 comments on commit d6aebfb

Please sign in to comment.