|
@@ -14,6 +14,7 @@ from django.views import View
|
|
|
from Ansjer.Config.gatewaySensorConfig import SMART_SCENE_TOPIC, SENSOR_TYPE, EVENT_TYPE
|
|
|
from Model.models import Device_Info, GatewaySubDevice, FamilyRoomDevice, SensorRecord, SmartScene, SceneLog, FamilyRoom
|
|
|
from Service.CommonService import CommonService
|
|
|
+from Object.ResponseObject import ResponseObject
|
|
|
|
|
|
|
|
|
class GatewaySubDeviceView(View):
|
|
@@ -28,6 +29,11 @@ class GatewaySubDeviceView(View):
|
|
|
return self.validation(request.POST, request, operation)
|
|
|
|
|
|
def validation(self, request_dict, request, operation):
|
|
|
+
|
|
|
+ if operation == 'update-online-status': # 更新子设备在线状态
|
|
|
+ response = ResponseObject()
|
|
|
+ return self.update_online_status(request_dict, response)
|
|
|
+
|
|
|
token_code, user_id, response = CommonService.verify_token_get_user_id(request_dict, request)
|
|
|
if token_code != 0:
|
|
|
return response.json(token_code)
|
|
@@ -53,8 +59,6 @@ class GatewaySubDeviceView(View):
|
|
|
return self.get_sensor_list(request_dict, response)
|
|
|
elif operation == 'device-list': # 获取设备信息
|
|
|
return self.get_device_list(request_dict, response)
|
|
|
- elif operation == 'update-online-status': # 更新子设备在线状态
|
|
|
- return self.update_online_status(request_dict, response)
|
|
|
else:
|
|
|
return response.json(414)
|
|
|
|