Explorar el Código

修复添加子设备存在问题

locky hace 3 años
padre
commit
44d4b98979
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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))