#pragma once

#include <WiFi.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>

#define CLIENT_ID "Bad"
#define MQTT_TOPIC "CYD/Bad/"
#define MQTT_PUB_TEMP "CYD/Bad/state/bme280"

#ifdef MQTT
WiFiClient espClient;
PubSubClient client(espClient);
#else
extern PubSubClient client;
#endif


void reconnect(void);
void doPublish(float temp, float hum, float tm, float hm);
void checkMQTT(void);
void setup_mqtt(void);