2022-01-10 23:37:21 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include "Const.h"
|
|
|
|
|
#include "classes/NotAsync.h"
|
|
|
|
|
#include "Global.h"
|
2022-02-15 11:37:31 +01:00
|
|
|
#include "utils/WiFiUtils.h"
|
2022-02-22 20:16:33 +01:00
|
|
|
#include "EventsAndOrders.h"
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
|
|
|
void mqttInit();
|
|
|
|
|
void selectBroker();
|
2022-02-11 00:22:59 +01:00
|
|
|
void getMqttData();
|
2022-01-10 23:37:21 +01:00
|
|
|
void getMqttData2();
|
|
|
|
|
bool isSecondBrokerSet();
|
|
|
|
|
boolean mqttConnect();
|
|
|
|
|
void mqttReconnect();
|
|
|
|
|
void mqttLoop();
|
|
|
|
|
void mqttSubscribe();
|
|
|
|
|
|
|
|
|
|
boolean publish(const String& topic, const String& data);
|
|
|
|
|
boolean publishData(const String& topic, const String& data);
|
|
|
|
|
boolean publishChart(const String& topic, const String& data);
|
|
|
|
|
boolean publishControl(String id, String topic, String state);
|
|
|
|
|
boolean publishChart_test(const String& topic, const String& data);
|
2022-02-02 21:17:50 +01:00
|
|
|
boolean publishStatusMqtt(const String& topic, const String& data);
|
2022-01-10 23:37:21 +01:00
|
|
|
boolean publishEvent(const String& topic, const String& data);
|
|
|
|
|
boolean publishInfo(const String& topic, const String& data);
|
|
|
|
|
boolean publishAnyJsonKey(const String& topic, const String& key, const String& data);
|
|
|
|
|
|
|
|
|
|
void publishWidgets();
|
|
|
|
|
void publishState();
|
|
|
|
|
|
|
|
|
|
void mqttCallback(char* topic, uint8_t* payload, size_t length);
|
2022-02-12 14:34:17 +01:00
|
|
|
void handleMqttStatus(bool send);
|
|
|
|
|
void handleMqttStatus(bool send, int state);
|
2022-08-25 00:45:17 +02:00
|
|
|
void sendAllFilesToMQTT();
|
2022-08-25 15:15:06 +02:00
|
|
|
void createOneSingleJson(String& json_array, String file);
|
2022-08-25 00:45:17 +02:00
|
|
|
|
2022-02-12 03:09:57 +01:00
|
|
|
const String getStateStr(int e);
|
2022-02-22 16:40:46 +01:00
|
|
|
|
|
|
|
|
void mqttUptimeCalc();
|
|
|
|
|
void wifiUptimeCalc();
|