#pragma once
#include "mqtt_client.h"
typedef enum wifi_evt{
    WIFI_CONNECTED,
    WIFI_CONNECT_FAIL,
    WIFI_DISCONNECTED,
    WIFI_GOT_IP
} wifi_evt;
typedef enum mqtt_evt{
    MQTT_CONNECTED,
    MQTT_CONNECT_FAIL,
    MQTT_DISCONNECTED,
    MQTT_DATA_RECEIVED
} mqtt_evt;
typedef void (*wifi_callback)(wifi_evt evt);
typedef void (*mqtt_callback)(mqtt_evt evt, esp_mqtt_event_handle_t evt_data);
void wifi_init_sta(wifi_callback cb);
void mqtt_app_start(mqtt_callback cb, EventGroupHandle_t evtGroup);
void mqtt_publish(const char *topic, const char *datas);

#define topicTempExt "house/temp/282A802600008059"
#define topicHauteurCuve "house/cuve/hauteur"
#define topicTempInt "house/temp/287DCF1E00008020"
#define topicHauteurCuveEvol "house/cuve/hauteurEvol"
#define topicConsoElec "energy/puissance_5mn"
#define topicEtatMachine "energy/machine_en_route"
#define topicdomoticCommand "domotic/cmd"
#define topicTest "test"

