mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
Merge branch 'main' of https://gitlab.sectorq.eu/sectorq/python
This commit is contained in:
@@ -19,14 +19,12 @@ import random
|
||||
import requests
|
||||
#import psutil
|
||||
stats = {}
|
||||
VERSION = "1.0.20"
|
||||
VERSION = "1.0.22"
|
||||
curos = platform.system()
|
||||
host = platform.node().lower()
|
||||
print(host)
|
||||
if curos == "Windows":
|
||||
import winreg
|
||||
|
||||
|
||||
def uptime():
|
||||
|
||||
try:
|
||||
@@ -936,11 +934,11 @@ def on_message(client, userdata, msg):
|
||||
client = mqtt.Client()
|
||||
payload = "off"
|
||||
client.username_pw_set("jaydee", password="jaydee1")
|
||||
client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=False)
|
||||
client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True)
|
||||
client.on_connect = on_connect
|
||||
client.on_message = on_message
|
||||
writeLog(MQTT_HOST)
|
||||
client.connect(MQTT_HOST, MQTT_PORT, 5)
|
||||
client.connect(MQTT_HOST, MQTT_PORT, 25)
|
||||
|
||||
# client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'?'}", qos=0, retain=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user