Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugwise] Add bridgeUID to thingUID during discovery #8445

Merged
merged 1 commit into from
Sep 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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