feat: save_voice_and_speak 优化
This commit is contained in:
parent
40c6479cf3
commit
494b078a09
|
@ -159,10 +159,9 @@ def save_voice_and_speak(event: Event):
|
||||||
if event.voice: # 如果已经生成了报警声音不用再请求
|
if event.voice: # 如果已经生成了报警声音不用再请求
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if getattr(settings, 'BD_SP_ENABLED', False):
|
|
||||||
_, event.voice, _ = generate_voice(event.voice_msg, v_p)
|
_, event.voice, _ = generate_voice(event.voice_msg, v_p)
|
||||||
event.save()
|
event.save()
|
||||||
if main_cate.speaker_on:
|
if main_cate.speaker_on and event.voice:
|
||||||
sps = []
|
sps = []
|
||||||
if event.area: # 如果事件存在发生区域
|
if event.area: # 如果事件存在发生区域
|
||||||
sps = list(TDevice.objects.filter(area=event.area,
|
sps = list(TDevice.objects.filter(area=event.area,
|
||||||
|
|
Loading…
Reference in New Issue