mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +01:00
ooo
This commit is contained in:
@@ -19,14 +19,12 @@ import random
|
|||||||
import requests
|
import requests
|
||||||
#import psutil
|
#import psutil
|
||||||
stats = {}
|
stats = {}
|
||||||
VERSION = "1.0.20"
|
VERSION = "1.0.22"
|
||||||
curos = platform.system()
|
curos = platform.system()
|
||||||
host = platform.node().lower()
|
host = platform.node().lower()
|
||||||
print(host)
|
print(host)
|
||||||
if curos == "Windows":
|
if curos == "Windows":
|
||||||
import winreg
|
import winreg
|
||||||
|
|
||||||
|
|
||||||
def uptime():
|
def uptime():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -936,11 +934,11 @@ def on_message(client, userdata, msg):
|
|||||||
client = mqtt.Client()
|
client = mqtt.Client()
|
||||||
payload = "off"
|
payload = "off"
|
||||||
client.username_pw_set("jaydee", password="jaydee1")
|
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_connect = on_connect
|
||||||
client.on_message = on_message
|
client.on_message = on_message
|
||||||
writeLog(MQTT_HOST)
|
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)
|
# 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