添加typeName
This commit is contained in:
@ -63,8 +63,7 @@ async def read_event():
|
||||
src_index = event_detail["srcIndex"]
|
||||
device_name = device_map.get(src_index, "未知设备")
|
||||
event_detail["deviceName"] = device_name
|
||||
# 添加regionName和typeName
|
||||
event_detail["typeName"] = event_type_str
|
||||
# 添加regionName
|
||||
if "srcName" in event_detail:
|
||||
event_detail["regionName"] = event_detail["srcName"]
|
||||
else:
|
||||
@ -96,6 +95,7 @@ async def read_event():
|
||||
event_detail["data"]["_detectionResult"] = (
|
||||
event_detail["data"].pop(detection_field_name)
|
||||
)
|
||||
event_detail["data"]["_detectionResult"]["typeName"] = event_type_str
|
||||
if isinstance(
|
||||
event_detail["data"]["_detectionResult"], list
|
||||
) and len(event_detail["data"]["_detectionResult"]):
|
||||
@ -125,8 +125,7 @@ async def read_event():
|
||||
# 添加设备名称
|
||||
src_index = event["srcIndex"]
|
||||
device_name = device_map.get(src_index, "未知设备")
|
||||
# 添加regionName和typeName
|
||||
event["typeName"] = event_type_str
|
||||
# 添加regionName
|
||||
if "srcName" in event:
|
||||
event["regionName"] = event["srcName"]
|
||||
else:
|
||||
@ -159,6 +158,7 @@ async def read_event():
|
||||
event["data"]["_detectionResult"] = event["data"].pop(
|
||||
detection_field_name
|
||||
)
|
||||
event["data"]["_detectionResult"]["typeName"] = event_type_str
|
||||
if isinstance(
|
||||
event["data"]["_detectionResult"], list
|
||||
) and len(event["data"]["_detectionResult"]):
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "hik-push"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
description = ""
|
||||
authors = ["quantulr <35954003+quantulr@users.noreply.github.com>"]
|
||||
readme = "README.md"
|
||||
|
Reference in New Issue
Block a user