ソースを参照

修复添加子设备存在问题

locky 3 年 前
コミット
44d4b98979
1 ファイル変更1 行追加1 行削除
  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))