Browse Source

修复添加子设备存在问题

locky 3 năm trước cách đây
mục cha
commit
44d4b98979
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Controller/SensorGateway/SubDeviceController.py

+ 1 - 1
Controller/SensorGateway/SubDeviceController.py

@@ -81,7 +81,7 @@ class GatewaySubDeviceView(View):
                                                              nickname=nickname, ieee_addr=ieee_addr, src_addr=src_addr,
                                                              status=1, created_time=now_time, updated_time=now_time)
                 FamilyRoomDevice.objects.create(family_id=family_id, room_id=room_id, device_id=device_id,
-                                                sub_device=sub_device, created_time=now_time, updated_time=now_time)
+                                                sub_device=sub_device.id, created_time=now_time, updated_time=now_time)
             return response.json(0)
         except Exception as e:
             return response.json(500, repr(e))