|
@@ -12,7 +12,7 @@ from django.views.generic.base import View
|
|
|
|
|
|
from Controller.SensorGateway.EquipmentFamilyController import EquipmentFamilyView
|
|
|
from Model.models import FamilyRoomDevice, FamilyRoom, GatewaySubDevice, Device_Info, UserFamily, FamilyMember, \
|
|
|
- UidSetModel, iotdeviceInfoModel
|
|
|
+ UidSetModel, iotdeviceInfoModel, SmartScene
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
|
|
@@ -255,7 +255,9 @@ class GatewayDeviceView(View):
|
|
|
'ieeeAddr': gateway_sub_qs['ieee_addr'],
|
|
|
'familyId': family_id,
|
|
|
})
|
|
|
- res = {'gateway': gateway, 'sub_device': sub_device, 'sub_device_count': len(sub_device), 'scene_count': 0}
|
|
|
+ scene_count = SmartScene.objects.filter(device_id=device_id).count()
|
|
|
+ res = {'gateway': gateway, 'sub_device': sub_device, 'sub_device_count': len(sub_device),
|
|
|
+ 'scene_count': scene_count}
|
|
|
return response.json(0, res)
|
|
|
|
|
|
except Exception as e:
|