Skip to content

Commit

Permalink
[plugwise] Add bridgeUID to thingUID during discovery (openhab#8445)
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored and CSchlipp committed Sep 12, 2020
1 parent 94be306 commit 347b239
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ public void activate() {

private DiscoveryResult createDiscoveryResult(DiscoveredNode node) {
String mac = node.macAddress.toString();
ThingUID thingUID = new ThingUID(PlugwiseUtils.getThingTypeUID(node.deviceType), mac);
ThingUID bridgeUID = stickHandler.getThing().getUID();
ThingUID thingUID = new ThingUID(PlugwiseUtils.getThingTypeUID(node.deviceType), bridgeUID, mac);

return DiscoveryResultBuilder.create(thingUID).withBridge(stickHandler.getThing().getUID())
return DiscoveryResultBuilder.create(thingUID).withBridge(bridgeUID)
.withLabel("Plugwise " + node.deviceType.toString())
.withProperty(PlugwiseBindingConstants.CONFIG_PROPERTY_MAC_ADDRESS, mac)
.withProperties(new HashMap<>(node.properties))
Expand Down

0 comments on commit 347b239

Please sign in to comment.