File tree 1 file changed +5
-2
lines changed
bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 12
12
*/
13
13
package org .openhab .binding .nuki .internal ;
14
14
15
+ import java .util .UUID ;
16
+
15
17
import org .eclipse .jdt .annotation .NonNullByDefault ;
16
18
import org .eclipse .jdt .annotation .Nullable ;
17
19
import org .eclipse .jetty .client .HttpClient ;
@@ -106,7 +108,7 @@ public void unregisterHandler(Thing thing) {
106
108
}
107
109
}
108
110
109
- private @ Nullable String createCallbackUrl (String id ) {
111
+ private @ Nullable String createCallbackUrl (@ Nullable String id ) {
110
112
final String ipAddress = networkAddressService .getPrimaryIpv4HostAddress ();
111
113
if (ipAddress == null ) {
112
114
logger .warn ("No network interface could be found to get callback address" );
@@ -118,7 +120,8 @@ public void unregisterHandler(Thing thing) {
118
120
logger .warn ("Cannot find port of the http service." );
119
121
return null ;
120
122
}
121
- String callbackUrl = NukiLinkBuilder .callbackUri (ipAddress , port , id ).toString ();
123
+ String callbackUrl = NukiLinkBuilder
124
+ .callbackUri (ipAddress , port , id != null ? id : UUID .randomUUID ().toString ()).toString ();
122
125
logger .trace ("callbackUrl[{}]" , callbackUrl );
123
126
return callbackUrl ;
124
127
}
You can’t perform that action at this time.
0 commit comments