Browse Source

A device created by gateway should be auto assigned to the customer that the gateway is assigned to

pull/870/head
Chen Xi 8 years ago
committed by Andrew Shvayka
parent
commit
5ba6b67cd5
  1. 1
      transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java

1
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);

Loading…
Cancel
Save