Browse Source

修复获取排程列表

peng 1 year ago
parent
commit
085940c009
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Controller/SensorGateway/SmartSwitchController.py

+ 2 - 2
Controller/SensorGateway/SmartSwitchController.py

@@ -174,7 +174,7 @@ class SmartSwitchView(View):
         try:
             switch_scheduler_qs = SwitchScheduler.objects.filter(device_id=device_id).values()
             if not switch_scheduler_qs.exists():
-                return response.json(173)
+                return response.json(0, [])
             switch_scheduler_list = []
             for item in switch_scheduler_qs:
                 switch_scheduler_list.append({
@@ -189,7 +189,7 @@ class SmartSwitchView(View):
                     'repeat': item['repeat'],
                     'isExecute': item['is_execute'],
                 })
-            return response.json(0, {'list': switch_scheduler_list})
+            return response.json(0, switch_scheduler_list)
         except Exception as e:
             print(e)
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))