Some small fixes
This commit is contained in:
@@ -61,7 +61,7 @@ powers = {"total": None, "total_house": None, "total_solar": None, "timestamp":
|
||||
|
||||
# define mqtt callbacks
|
||||
def on_connect(client, userdata, flags, reason_code, properties):
|
||||
print(f"{bcolors.OKGREEN}Connected with result code {bcolors.ENDC}{reason_code}")
|
||||
print(f"{bcolors.OKGREEN}Connected to the MQTT broker ({mq_broker}:{mq_port}) with result code {bcolors.ENDC}{reason_code}{bcolors.OKGREEN}.{bcolors.ENDC}")
|
||||
client.subscribe("lge320/#")
|
||||
client.subscribe("solar/ac/#")
|
||||
def on_message(client, userdata, msg):
|
||||
@@ -83,6 +83,7 @@ mqttc.connect(mq_broker, mq_port, 60)
|
||||
|
||||
mqttc.loop_start()
|
||||
|
||||
|
||||
def threaded_current_power_calculation():
|
||||
while True:
|
||||
last_powers = powers_raw.copy()
|
||||
|
Reference in New Issue
Block a user