From 5ba6b67cd5730f6c8af1ff1f26ea3112c158bb18 Mon Sep 17 00:00:00 2001 From: Chen Xi Date: Fri, 8 Jun 2018 23:34:12 +0800 Subject: [PATCH] A device created by gateway should be auto assigned to the customer that the gateway is assigned to --- .../server/transport/mqtt/session/GatewaySessionCtx.java | 1 + 1 file changed, 1 insertion(+) diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java index cc825b92b8..cfba944952 100644 --- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java +++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java @@ -90,6 +90,7 @@ public class GatewaySessionCtx { device.setTenantId(gateway.getTenantId()); device.setName(deviceName); device.setType(deviceType); + device.setCustomerId(gateway.getCustomerId()); device = deviceService.saveDevice(device); relationService.saveRelationAsync(new EntityRelation(gateway.getId(), device.getId(), "Created")); processor.onDeviceAdded(device);