From 9ff40fa306221efa064f8e46c87219b87fb37091 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 30 Dec 2022 09:37:42 +0100 Subject: [PATCH 1/2] ok --- mqtt_srv.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mqtt_srv.py b/mqtt_srv.py index 8abaed0..cc82818 100644 --- a/mqtt_srv.py +++ b/mqtt_srv.py @@ -18,8 +18,6 @@ import getopt import random import requests #import psutil - - stats = {} VERSION = "1.0.20" curos = platform.system() From d62166d109f9c536397a4a5b5b31d1a65f8ba803 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 30 Dec 2022 12:29:55 +0100 Subject: [PATCH 2/2] lala --- auto_import.py | 4 +++- mqtt_srv.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/auto_import.py b/auto_import.py index 4b4d23c..c03523d 100644 --- a/auto_import.py +++ b/auto_import.py @@ -15,7 +15,7 @@ _IMP_FILE = "/share/external/DEV3304_1/auto_import" _DEV_DATA = "/share/external/DEV3304_1/MISC/version.txt" - +print("###############") #sys.exit() while True: @@ -37,6 +37,8 @@ while True: print("--------------") print(strValue) _DEV_CONT = json.loads(strValue) + print(_DEV_CONT) + print(_DEV_CONT["wifi mac"]) wifimac = _DEV_CONT["wifi mac"] if wifimac == "2474f742c017": _DEV = "gopro9_1" diff --git a/mqtt_srv.py b/mqtt_srv.py index d1c0d4b..a5c6657 100644 --- a/mqtt_srv.py +++ b/mqtt_srv.py @@ -1039,6 +1039,7 @@ if curos == "Windows": r = json.dumps(results) #client.publish("home-assistant/" + host + "/hwstats", payload='{"TPCHDIO":"' + str(results["TPCHDIO"]) + '", "SMEMUTI":"' + str(results["SMEMUTI"]) + '", "TCPU":"' + str(results["TCPU"]) + '", "TGPU1DIO":"' + str(results["TGPU1DIO"]) + '", "SGPU1BIUTI":"' + str(results["SGPU1BIUTI"]) + '", "FCPU":"' + str(results["FCPU"]) + '", "SVIRTMEMUTI":"' + str(results["SVIRTMEMUTI"]) + '", "SCPUUTI":"' + str(results["SCPUUTI"]) + '"}', qos=0, retain=False) client.publish("home-assistant/" + host + "/hwstats", payload=r, qos=0, retain=False) + client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) #print(json.dumps(stats)) #writeLog(json.dumps(stats)) else: