소스 검색

记录手动日志

peng 1 년 전
부모
커밋
b93e66d17c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      Controller/SensorGateway/SmartSwitchController.py

+ 6 - 0
Controller/SensorGateway/SmartSwitchController.py

@@ -539,6 +539,12 @@ class SmartSwitchView(View):
                 scene_qs = SceneLog.objects.filter(created_time=send_time, device_id=device_id, scene_name=scheduler_id)
                 tasks = json.dumps({'timePoint': int(send_time), 'actions': int(switch_status)})
                 scene_id = 0
+            elif event_type == '4':
+                scene_log['tasks'] = json.dumps({'timePoint': int(implement_time), 'actions': int(switch_status)})
+                scene_log['scene_id'] = 0
+                scene_log['scene_name'] = 'switchmanual'
+                SceneLog.objects.create(**scene_log)
+                return response.json(0)
             else:
                 return response.json(444, {'error param': 'event_type'})
             if scene_qs.exists():