modify ip 音柱分区域告警

This commit is contained in:
2026-09-18 14:26:25 +08:00
parent e0211105bd
commit 6a8c63b9f2
+7 -1
View File
@@ -501,9 +501,15 @@ async def alarm_report(
# 2. ip 音柱 TTS 播放(可通过配置开关关闭),失败时仅记录日志,不影响主流程 # 2. ip 音柱 TTS 播放(可通过配置开关关闭),失败时仅记录日志,不影响主流程
from .global_var import ip_sound_column_volume, ip_sound_column_tts from .global_var import ip_sound_column_volume, ip_sound_column_tts
properties = full_data.get("Result", {}).get("Properties", [])
area = ""
if len(properties) > 0:
properties_dict = {prop.get("property", ""): prop.get("value", "") for prop in properties}
area = f"{properties_dict.get('IntrudeRegionId', '')},"
tts_text = ip_sound_column_tts.get( tts_text = ip_sound_column_tts.get(
full_data.get("Summary", ""), full_data.get("Summary", ""),
f"告警: {full_data.get('Summary', '')}" f"告警: {area}{full_data.get('TaskDesc', '')}"
) )
tts_payload = { tts_payload = {