|
@@ -260,7 +260,7 @@ class GatewayFamilyRoomView(View):
|
|
device_type = device['device__Type']
|
|
device_type = device['device__Type']
|
|
category = device['category']
|
|
category = device['category']
|
|
room_name = FamilyRoom.objects.filter(id=room_id)
|
|
room_name = FamilyRoom.objects.filter(id=room_id)
|
|
- if category == 0: # 网关设备
|
|
|
|
|
|
+ if category == 0: # 网关子设备
|
|
if not device['sub_device']:
|
|
if not device['sub_device']:
|
|
device_dict = {
|
|
device_dict = {
|
|
'deviceId': device['device_id'],
|
|
'deviceId': device['device_id'],
|
|
@@ -271,6 +271,8 @@ class GatewayFamilyRoomView(View):
|
|
else:
|
|
else:
|
|
sub_device_qs = GatewaySubDevice.objects.filter(id=device['sub_device']).values('device_type',
|
|
sub_device_qs = GatewaySubDevice.objects.filter(id=device['sub_device']).values('device_type',
|
|
'nickname')
|
|
'nickname')
|
|
|
|
+ if not sub_device_qs.exists():
|
|
|
|
+ continue
|
|
device_dict = {
|
|
device_dict = {
|
|
'deviceId': device['sub_device'],
|
|
'deviceId': device['sub_device'],
|
|
'deviceType': sub_device_qs[0]['device_type'],
|
|
'deviceType': sub_device_qs[0]['device_type'],
|