#pragma once

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

//#define MQTT_BROKER "rexfue.de"
#define MQTT_BROKER "nuccy"
#define MQTT_PORT  1883
//#define MQTT_USER "stzuhr"
//#define MQTT_PASSWD "74chQCYb"
#define MQTT_USER "rxf"
#define MQTT_PASSWD "Tux4S!ech"

#define MQTT_TOPIC "CYD/set/"
#define MQTT_PUB_TEMP "CYD/get/bme280"

#define CLIENT_ID "ESP32Client7"

#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);