update
This commit is contained in:
parent
ec56048bc9
commit
1178fb979d
45
config.py
45
config.py
|
@ -141,7 +141,50 @@ def insert_to_warning_sql(deviceId, v, t):
|
|||
ml.append("solve")
|
||||
dt.append("TEXT")
|
||||
dt.append("TEXT")
|
||||
v.append("无")
|
||||
# 设置原因和解决方案
|
||||
# 解决方案可以调用AI进行生成回答
|
||||
if t == 0:
|
||||
# RFID 温度
|
||||
temperature = v[1]
|
||||
prompt = f"动物体温为{temperature},正常吗?如果体温过高或过低,如何解决?"
|
||||
if temperature_threshold[1] <= temperature:
|
||||
v.append("体温过高")
|
||||
elif temperature <= temperature_threshold[0]:
|
||||
v.append("体温过低")
|
||||
elif t == 1:
|
||||
# air 空气、湿度
|
||||
air_temperature = v[1]
|
||||
air_humidity = v[2]
|
||||
prompt = f"室外天气温度为{air_temperature},室外天气湿度{air_humidity},正常吗?如果过高或过低,如何解决?"
|
||||
if air_temperature_threshold[1] <= air_temperature:
|
||||
v.append("室外天气温度偏高")
|
||||
elif air_temperature <= air_temperature_threshold[0]:
|
||||
v.append("室外天气温度偏低")
|
||||
elif air_humidity_threshold[1] <= air_humidity:
|
||||
v.append("室外天气湿度偏高")
|
||||
elif air_humidity <= air_humidity_threshold[0]:
|
||||
v.append("室外天气湿度偏低")
|
||||
elif t == 2:
|
||||
# danqi 氮气
|
||||
danqi = v[1]
|
||||
prompt = f"空气中氮气浓度为{danqi},正常吗?如果过高或过低,如何解决?"
|
||||
v.append("氮气浓度偏高")
|
||||
elif t == 3:
|
||||
# jiawan 甲烷
|
||||
jiawan = v[1]
|
||||
prompt = f"空气中甲烷浓度为{jiawan},正常吗?如果过高或过低,如何解决?"
|
||||
v.append("甲烷浓度过高")
|
||||
elif t == 4:
|
||||
# zaoyin 噪音
|
||||
zaoyin = v[1]
|
||||
prompt = f"噪音分贝为{zaoyin},正常吗?如果过高或过低,如何解决?"
|
||||
v.append("噪音强度过高")
|
||||
elif t == 5:
|
||||
# yanwu 烟雾
|
||||
yanwu = v[1]
|
||||
prompt = f"烟雾浓度为{yanwu},正常吗?如果过高或过低,如何解决?"
|
||||
v.append("烟雾浓度偏高")
|
||||
|
||||
v.append("无")
|
||||
return {
|
||||
"devices": ["root.warning." + deviceId],
|
||||
|
|
Loading…
Reference in New Issue