mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Discovery HA and HomeD
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
#include <PubSubClient.h>
|
||||
#include <list>
|
||||
|
||||
#ifdef libretiny
|
||||
#include <vector>
|
||||
#include <typedef.h>
|
||||
#ifdef STANDARD_WEB_SERVER
|
||||
#include <WebServer.h>
|
||||
#endif
|
||||
#include <HTTPClient.h>
|
||||
#endif
|
||||
|
||||
#ifdef ESP32
|
||||
#include "WiFi.h"
|
||||
#include <HTTPClient.h>
|
||||
@@ -22,6 +31,7 @@
|
||||
|
||||
#ifdef ASYNC_WEB_SERVER
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include "AsyncWebServer.h"
|
||||
#endif
|
||||
|
||||
#ifdef STANDARD_WEB_SERVER
|
||||
@@ -60,6 +70,9 @@ extern IoTItem* rtcItem;
|
||||
extern IoTItem* tlgrmItem;
|
||||
extern IoTBench* benchLoadItem;
|
||||
extern IoTBench* benchTaskItem;
|
||||
extern IoTDiscovery* HADiscovery;
|
||||
extern IoTDiscovery* HOMEdDiscovery;
|
||||
|
||||
|
||||
extern TickerScheduler ts;
|
||||
extern WiFiClient espClient;
|
||||
@@ -77,6 +90,9 @@ extern ESP8266HTTPUpdateServer httpUpdater;
|
||||
#ifdef ESP32
|
||||
extern WebServer HTTP;
|
||||
#endif
|
||||
#ifdef libretiny
|
||||
extern WebServer HTTP;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef STANDARD_WEB_SOCKETS
|
||||
|
||||
36
include/classes/IoTDiscovery.h
Normal file
36
include/classes/IoTDiscovery.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
|
||||
class IoTDiscovery : public IoTItem
|
||||
{
|
||||
public:
|
||||
IoTDiscovery(const String ¶meters);
|
||||
~IoTDiscovery();
|
||||
|
||||
// inline bool isDiscoveryHomed() { return HOMEd; }
|
||||
|
||||
// inline bool isDiscoveryHA() { return HA; }
|
||||
|
||||
String HOMEdTopic = "";
|
||||
String HATopic = "";
|
||||
//String ChipId = "";
|
||||
|
||||
virtual void mqttSubscribeDiscovery();
|
||||
|
||||
virtual void publishStatusHOMEd(const String &topic, const String &data);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
boolean publishRetain(const String &topic, const String &data);
|
||||
virtual void getlayoutHA();
|
||||
virtual void deleteFromHOMEd();
|
||||
virtual void getlayoutHOMEd();
|
||||
|
||||
//bool HOMEd = false;
|
||||
//bool HA = false;
|
||||
//String HOMEdTopic;
|
||||
|
||||
};
|
||||
@@ -59,6 +59,8 @@ class IoTItem {
|
||||
//virtual IoTBench* getBenchmark();
|
||||
virtual IoTBench*getBenchmarkTask();
|
||||
virtual IoTBench*getBenchmarkLoad();
|
||||
virtual IoTBench*getHADiscovery();
|
||||
virtual IoTBench*getHOMEdDiscovery();
|
||||
virtual unsigned long getRtcUnixTime();
|
||||
|
||||
// делаем доступным модулям отправку сообщений в телеграм
|
||||
|
||||
Reference in New Issue
Block a user