ソースを参照

修改网关门磁被拆动/拆动恢复event_type

locky 1 年間 前
コミット
4925033f8a

+ 1 - 1
AnsjerPush/Config/gatewaySensorConfig.py

@@ -24,7 +24,7 @@ EVENT_TYPE = {
     # 门磁
     'door_magnet_opening': 2150,
     'door_magnet_closure': 2151,
-    'door_magnet_removal': 2152,
+    'door_magnet_removal': 2156,
     'door_magnet_low_power': 2153,
     'door_magnet_start_detection': 2154,
     'door_magnet_closure_detection': 2155,

+ 1 - 1
Controller/DetectControllerV2.py

@@ -65,7 +65,7 @@ class NotificationV2View(View):
             uid = DevicePushService.decode_uid(etk, uidToken)
             if len(uid) != 20 and len(uid) != 14:
                 return JsonResponse(status=200, data={'code': 404, 'msg': 'wrong uid'})
-            TIME_LOGGER.info('开始推送,uid:{},n_time:{},事件类型:{}'.format(uid, n_time, event_type))
+            TIME_LOGGER.info('开始推送,uid:{},事件类型:{},n_time:{}'.format(uid, event_type, n_time))
             # 判断是否为系统消息
             is_sys_msg = DevicePushService.judge_sys_msg(event_type)
             if is_sys_msg:

+ 6 - 6
Controller/gatewayController.py

@@ -96,9 +96,9 @@ class GatewayView(View):
             SensorRecord.objects.create(**sensor_record_dict)
 
             # 门磁被拆动/拆动恢复,修改拆动状态
-            if event_type == 2152:
+            if event_type == 2156:
                 gateway_sub_device_qs.update(is_tampered=1)
-            elif event_type == 2156:
+            elif event_type == 2152:
                 gateway_sub_device_qs.update(is_tampered=0)
 
             # 撤防状态不推送
@@ -199,9 +199,9 @@ class GatewayView(View):
                 alarm = '门磁开'
             elif event_type == 2151:
                 alarm = '门磁关'
-            elif event_type == 2152:
-                alarm = '被拆动'
             elif event_type == 2156:
+                alarm = '被拆动'
+            elif event_type == 2152:
                 alarm = '拆动恢复'
 
             # 智能按钮
@@ -241,9 +241,9 @@ class GatewayView(View):
                 alarm = 'Door magnetic opening'
             elif event_type == 2151:
                 alarm = 'Door magnetic closing'
-            elif event_type == 2152:
-                alarm = 'Be dismantled'
             elif event_type == 2156:
+                alarm = 'Be dismantled'
+            elif event_type == 2152:
                 alarm = 'Dismantling recovery'
 
             # 智能按钮