|
@@ -12,6 +12,7 @@ from django.views.generic.base import View
|
|
|
from Ansjer.config import OSS_STS_ACCESS_SECRET, OSS_STS_ACCESS_KEY
|
|
|
from Controller.CheckUserData import RandomStr
|
|
|
from Controller.DeviceConfirmRegion import Device_Region
|
|
|
+from Controller.SensorGateway.EquipmentFamilyController import EquipmentFamilyView
|
|
|
from Model.models import Device_Info, UID_Bucket, UID_Preview, UidSetModel, UidChannelSetModel, \
|
|
|
Device_User, iotdeviceInfoModel, UIDCompanySerialModel, UIDModel, UnicomDeviceInfo
|
|
|
from Object.ResponseObject import ResponseObject
|
|
@@ -78,6 +79,9 @@ class EquipmentManagerV3(View):
|
|
|
version = request_dict.get('version', '')
|
|
|
isCheckMainUser = request_dict.get('isCheckMainUser', None)
|
|
|
|
|
|
+ family_id = request_dict.get('familyId', None)
|
|
|
+ room_id = request_dict.get('roomId', None)
|
|
|
+
|
|
|
if not all([UID, NickName, View_Account, Type, ChannelIndex]): # Type和ChannelIndex可能为0
|
|
|
return response.json(444, {'param': 'UID, NickName, View_Account, Type, ChannelIndex'})
|
|
|
|
|
@@ -104,6 +108,10 @@ class EquipmentManagerV3(View):
|
|
|
main_exist = Device_Info.objects.filter(UID=UID)
|
|
|
main_exist = main_exist.filter(~Q(vodPrimaryUserID='')).values('vodPrimaryUserID', 'vodPrimaryMaster')
|
|
|
|
|
|
+ # 添加到家庭房间
|
|
|
+ if family_id:
|
|
|
+ EquipmentFamilyView.family_room_device_save(family_id, room_id, id)
|
|
|
+
|
|
|
vodPrimaryUserID = userID
|
|
|
vodPrimaryMaster = userName
|
|
|
primaryUserID = ''
|