diff --git a/src/main/java/com/armzilla/ha/upnp/UpnpListener.java b/src/main/java/com/armzilla/ha/upnp/UpnpListener.java index 00e59ec..686bc2e 100644 --- a/src/main/java/com/armzilla/ha/upnp/UpnpListener.java +++ b/src/main/java/com/armzilla/ha/upnp/UpnpListener.java @@ -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); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ed8db7f..fec7dba 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,4 @@ upnp.response.port=50000 server.port=8080 upnp.config.address=192.168.1.1 +upnp.disable=false