Add file influxdb_info and use information from the file

This commit is contained in:
DingZQ
2025-02-08 21:06:59 +08:00
parent d8c8eb1002
commit 6b1b15f28c
7 changed files with 43 additions and 18 deletions

View File

@@ -12,11 +12,12 @@ from tjnetwork import *
import schedule
import threading
import globals
import influxdb_info
# influxdb数据库连接信息
url = "http://localhost:8086" # 替换为你的InfluxDB实例地址
token = "Z4UZj9HuLwLlwoApywvT2nGVP3bwLy18y-sJQ7enzZlJd8YMzMWbBA6F-q4gBiZ-7-IqdxR5aR9LvicKiSNmnA==" # 替换为你的InfluxDB Token
org_name = "beibei" # 替换为你的Organization名称
url = influxdb_info.url
token = influxdb_info.token
org_name = influxdb_info.org
client = InfluxDBClient(url=url, token=token, org=org_name)
# # 所有实时更新数据的SCADA设备的ID
@@ -1303,9 +1304,9 @@ def query_curve_by_ID_property_daterange(ID: str, type: str, property: str, star
# 示例调用
if __name__ == "__main__":
url = "http://localhost:8086" # 替换为你的InfluxDB实例地址
token = "Z4UZj9HuLwLlwoApywvT2nGVP3bwLy18y-sJQ7enzZlJd8YMzMWbBA6F-q4gBiZ-7-IqdxR5aR9LvicKiSNmnA==" # 替换为你的InfluxDB Token
org_name = "beibei" # 替换为你的Organization名称
url = influxdb_info.url
token = influxdb_info.token
org_name = InfluxDBClient.org
client = InfluxDBClient(url=url, token=token)