Browse Source

删除插座changeReport

locky 1 năm trước cách đây
mục cha
commit
5e31360bcb
1 tập tin đã thay đổi với 0 bổ sung26 xóa
  1. 0 26
      Controller/SensorGateway/SmartSocketController.py

+ 0 - 26
Controller/SensorGateway/SmartSocketController.py

@@ -230,8 +230,6 @@ class SmartSocketView(View):
         result = cls.save_socket_switch(device_id, serial_number, status)
         if not result:
             return response.json(177)
-        cause_type = 'APP_INTERACTION'
-        cls.change_report_alexa_socket(serial_number, status, cause_type)
         return response.json(0)
 
     @staticmethod
@@ -940,27 +938,6 @@ class SmartSocketView(View):
             print(e)
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 
-    @staticmethod
-    def change_report_alexa_socket(serial_number, status, cause_type):
-        """
-        请求修改插座状态
-        @param serial_number: 序列号
-        @param status: 开关状态,1:开, 0:关
-        @param cause_type: 原因类型
-        @return:
-        """
-        url = '{}deviceStatus/changeReportSwitch'.format(ALEXA_DOMAIN)
-        value = 'ON' if status == 1 else 'OFF'
-        data = {
-            'serial_number': serial_number,
-            'value': value,
-            'cause_type': cause_type
-        }
-        try:
-            requests.post(url=url, data=data, timeout=5)
-        except Exception as e:
-            print(repr(e))
-
     @classmethod
     def delete_alexa_socket(cls, serial_number):
         url = '{}deviceStatus/deleteSwitch'.format(ALEXA_DOMAIN)
@@ -992,9 +969,6 @@ class SmartSocketView(View):
                 'created_time': now_time,
             }
             SceneLog.objects.create(**log_dict)
-
-            cause_type = 'PHYSICAL_INTERACTION'
-            cls.change_report_alexa_socket(serial_number, status, cause_type)
             LOGGER.info('成功接收并保存,插座序列号{},状态:{}'.format(serial_number, status))
             return response.json(0)
         except Exception as e: