Reset Serial communication statistic at start

This commit is contained in:
Ollo 2024-12-07 16:25:54 +01:00
parent f954cecfc0
commit 037b2ef12c

View File

@ -5,7 +5,7 @@ from paho.mqtt import client as mqtt_client
import os import os
import serial import serial
MAXIMUM_COMMUNICATION_FAILURE=100 MAXIMUM_COMMUNICATION_FAILURE=1000
TEMPERATUR_MIN_DIFFERENCE = 2 TEMPERATUR_MIN_DIFFERENCE = 2
TARGET_MIN_DIFFERENCE = 1 TARGET_MIN_DIFFERENCE = 1
@ -59,7 +59,9 @@ client.loop_start()
client.publish(mqtt_topic + "device", ser.name) # check which port was really used client.publish(mqtt_topic + "device", ser.name) # check which port was really used
# Reset Serial Communication statistic
SerialCommunicationFailureCounter=0 SerialCommunicationFailureCounter=0
client.publish(mqtt_topic + "serialcom/failure", str(SerialCommunicationFailureCounter))
# store last published value # store last published value
lastTemperatur = -1 lastTemperatur = -1