Merge branch 'ver4dev' into FixLog

This commit is contained in:
2023-10-03 22:26:05 +03:00
committed by GitHub
63 changed files with 1737 additions and 1319 deletions

View File

@@ -24,10 +24,18 @@
#define FIRMWARE_NAME "esp8266_4mb"
#endif
#ifdef esp8266_16mb
#define FIRMWARE_NAME "esp8266_16mb"
#endif
#ifdef esp32_4mb
#define FIRMWARE_NAME "esp32_4mb"
#endif
#ifdef esp32_16mb
#define FIRMWARE_NAME "esp32_16mb"
#endif
#ifdef esp32s2_4mb
#define FIRMWARE_NAME "esp32s2_4mb"
#endif

View File

@@ -14,6 +14,7 @@ boolean mqttConnect();
void mqttReconnect();
void mqttLoop();
void mqttSubscribe();
bool mqttIsConnect();
boolean publish(const String& topic, const String& data);
boolean publishData(const String& topic, const String& data);
@@ -21,6 +22,7 @@ boolean publishChartMqtt(const String& topic, const String& data);
boolean publishJsonMqtt(const String& topic, const String& json);
boolean publishStatusMqtt(const String& topic, const String& data);
boolean publishEvent(const String& topic, const String& data);
void mqttSubscribeExternal(String topic, bool usePrefix);
bool publishChartFileToMqtt(String path, String id, int maxCount);

View File

@@ -11,7 +11,7 @@ struct IoTValue {
class IoTItem {
public:
IoTItem(const String& parameters);
virtual ~IoTItem() {}
virtual ~IoTItem() {};
virtual void loop();
virtual void doByInterval();
virtual IoTValue execute(String command, std::vector<IoTValue>& param);
@@ -35,9 +35,12 @@ class IoTItem {
void setInterval(long interval);
void setIntFromNet(int interval);
unsigned long currentMillis;
unsigned long prevMillis;
unsigned long difference;
// unsigned long currentMillis;
// unsigned long prevMillis;
// unsigned long difference;
unsigned long nextMillis=0; // достаточно 1 переменной, надо экономить память
// задержка следующего вызова, не изменяет текущий _interval
void suspendNextDoByInt(unsigned long _delay); // 0 - force
IoTValue value; // хранение основного значения, которое обновляется из сценария, execute(), loop() или doByInterval()

View File

@@ -15,6 +15,7 @@ extern bool jsonRead(const String& json, String key, float& value, bool e = true
extern bool jsonRead(const String& json, String key, String& value, bool e = true);
extern bool jsonRead(const String& json, String key, bool& value, bool e = true);
extern bool jsonRead(const String& json, String key, int& value, bool e = true);
extern bool jsonReadArray(const String& json, String key, std::vector<String>& jArray, bool e = true);
extern String jsonReadStr(const String& json, String name, bool e = true);
extern int jsonReadInt(const String& json, String name, bool e = true);

View File

@@ -2,11 +2,10 @@
#include "Global.h"
#include "MqttClient.h"
boolean isNetworkActive();
uint8_t getNumAPClients();
void routerConnect();
bool startAPMode();
boolean RouterFind(String ssid);
boolean RouterFind(std::vector<String> jArray);
uint8_t RSSIquality();
extern void wifiSignalInit();