|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
from django.views import View
|
|
from django.views import View
|
|
|
|
|
|
-from Model.models import SwitchInfo, SwitchDimmingSettings, SwitchChronopher
|
|
|
|
|
|
+from Model.models import SwitchInfo, SwitchDimmingSettings, SwitchChronopher, Device_Info, FamilyRoom
|
|
from Service.CommonService import CommonService
|
|
from Service.CommonService import CommonService
|
|
|
|
|
|
|
|
|
|
@@ -26,15 +26,15 @@ class SmartSwitchView(View):
|
|
token_code, user_id, response = CommonService.verify_token_get_user_id(request_dict, request)
|
|
token_code, user_id, response = CommonService.verify_token_get_user_id(request_dict, request)
|
|
if token_code != 0:
|
|
if token_code != 0:
|
|
return response.json(token_code)
|
|
return response.json(token_code)
|
|
- if operation == 'get-switch-info': # 设备获取智能开关数据
|
|
|
|
|
|
+ if operation == 'get-switch-info': # 设备获取智能开关数据
|
|
return self.get_switch_info(request_dict, response)
|
|
return self.get_switch_info(request_dict, response)
|
|
- elif operation == 'get-switch-setting': # 获取智能开关调光设置
|
|
|
|
|
|
+ elif operation == 'get-switch-setting': # 获取智能开关调光设置
|
|
return self.get_switch_setting(request_dict, response)
|
|
return self.get_switch_setting(request_dict, response)
|
|
- elif operation == 'get-chronopher-setting': # 获取定时计划
|
|
|
|
|
|
+ elif operation == 'get-chronopher-setting': # 获取定时计划
|
|
return self.get_chronopher_setting(request_dict, response)
|
|
return self.get_chronopher_setting(request_dict, response)
|
|
- elif operation == 'add-or-edit-chronopher': # 添加/编辑定时计划
|
|
|
|
|
|
+ elif operation == 'add-or-edit-chronopher': # 添加/编辑定时计划
|
|
return self.add_or_edit_chronopher(request_dict, response)
|
|
return self.add_or_edit_chronopher(request_dict, response)
|
|
- elif operation == 'delete-chronopher': # 删除定时计划
|
|
|
|
|
|
+ elif operation == 'delete-chronopher': # 删除定时计划
|
|
return self.delete_chronopher(request_dict, response)
|
|
return self.delete_chronopher(request_dict, response)
|
|
else:
|
|
else:
|
|
return response.json(414)
|
|
return response.json(414)
|
|
@@ -67,7 +67,7 @@ class SmartSwitchView(View):
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
- def get_switch_setting(request_dict, response, user_id):
|
|
|
|
|
|
+ def get_switch_setting(request_dict, response):
|
|
"""
|
|
"""
|
|
获取智能开关设备设置信息
|
|
获取智能开关设备设置信息
|
|
@param request_dict: 请求参数
|
|
@param request_dict: 请求参数
|