Add Tapo T315 data exporter and adjust export schedule intervals

This commit is contained in:
2025-02-05 12:52:05 +08:00
parent 665a8ea05a
commit 4b01efc39b

View File

@@ -8,6 +8,7 @@ from awinlib.PrometheusDataExporter import (
CpuFanTempDataExporter, CpuFanTempDataExporter,
HddTempDataExporter, HddTempDataExporter,
KasaPowerStripDataExporter, KasaPowerStripDataExporter,
TapoT315DataExporter,
) )
from awinlib.utilities import datetimeNow, loadJson, log from awinlib.utilities import datetimeNow, loadJson, log
@@ -59,8 +60,8 @@ def main(configs):
t315Atticexporter = TapoT315DataExporter(secrect["ip"], secrect["username"], secrect["password"], "鐵皮屋-溫濕度感測器", "attic-sensors") t315Atticexporter = TapoT315DataExporter(secrect["ip"], secrect["username"], secrect["password"], "鐵皮屋-溫濕度感測器", "attic-sensors")
gaugeDict = {} gaugeDict = {}
schedule.every( 1).seconds.do(exportData, gaugeDict=gaugeDict, exporters=(hddTempExporter, cpuFanTempExporter, powerStripLivingroomExporter, powerStripAtticExporter)) schedule.every( 5).seconds.do(exportData, gaugeDict=gaugeDict, exporters=(hddTempExporter, cpuFanTempExporter, powerStripLivingroomExporter, powerStripAtticExporter))
schedule.every(5).seconds.do(exportData, gaugeDict=gaugeDict, exporters=(t315Atticexporter,)) schedule.every(60).seconds.do(exportData, gaugeDict=gaugeDict, exporters=(t315Atticexporter,))
## Start Prometheus server ## Start Prometheus server
prometheusServerPort = configs.get("port", DEFAULT_PORT) prometheusServerPort = configs.get("port", DEFAULT_PORT)