Fixed logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-10-02 16:37:00 +02:00
parent a06e94147a
commit 5d4b3cfe60

View File

@ -49,12 +49,15 @@ def timer_tick(*args) -> None:
def mqtt_on_connect(client, userdata, flags, rc): def mqtt_on_connect(client, userdata, flags, rc):
BirbnetesIoTPlatformStatusDriver.enqueue_pattern('green', [1]) BirbnetesIoTPlatformStatusDriver.enqueue_pattern('green', [1])
client.subscribe(f"command/{config.DEVICE_ID}") client.subscribe(f"command/{config.DEVICE_ID}")
logging.error("MQTT Connected!") logging.info("MQTT Connected!")
def mqtt_on_disconnect(client, userdata, rc): def mqtt_on_disconnect(client, userdata, rc):
BirbnetesIoTPlatformStatusDriver.enqueue_pattern('red', [1]) if rc != 0:
logging.error("Unexpected MQTT Disconnect") logging.error(f"Unexpected MQTT Disconnect. RC: {rc}")
BirbnetesIoTPlatformStatusDriver.enqueue_pattern('red', [1])
else:
logging.debug("MQTT Disconnected")
def mqtt_on_command(client, userdata, message): def mqtt_on_command(client, userdata, message):