mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix standalone compiling
This commit is contained in:
@@ -8,10 +8,6 @@
|
|||||||
#include <ESPUtils.h>
|
#include <ESPUtils.h>
|
||||||
#include <uuid/common.h>
|
#include <uuid/common.h>
|
||||||
|
|
||||||
#include "../../src/system.h"
|
|
||||||
#include "../../src/mqtt.h"
|
|
||||||
#include "../../src/dallassensor.h"
|
|
||||||
|
|
||||||
#define MQTT_RECONNECTION_DELAY 1000
|
#define MQTT_RECONNECTION_DELAY 1000
|
||||||
|
|
||||||
#define MQTT_SETTINGS_FILE "/config/mqttSettings.json"
|
#define MQTT_SETTINGS_FILE "/config/mqttSettings.json"
|
||||||
@@ -71,6 +67,10 @@ static String generateClientId() {
|
|||||||
#define EMSESP_DEFAULT_HA_ENABLED false
|
#define EMSESP_DEFAULT_HA_ENABLED false
|
||||||
#define EMSESP_DEFAULT_PUBLISH_TIME 10
|
#define EMSESP_DEFAULT_PUBLISH_TIME 10
|
||||||
|
|
||||||
|
#include "../../src/system.h"
|
||||||
|
#include "../../src/mqtt.h"
|
||||||
|
#include "../../src/dallassensor.h"
|
||||||
|
|
||||||
class MqttSettings {
|
class MqttSettings {
|
||||||
public:
|
public:
|
||||||
// host and port - if enabled
|
// host and port - if enabled
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class DummySettings {
|
|||||||
uint8_t dallas_format = 1;
|
uint8_t dallas_format = 1;
|
||||||
uint8_t ha_climate_format = 1;
|
uint8_t ha_climate_format = 1;
|
||||||
bool ha_enabled = true;
|
bool ha_enabled = true;
|
||||||
|
std::string base = "ems-esp";
|
||||||
|
|
||||||
String hostname = "ems-esp";
|
String hostname = "ems-esp";
|
||||||
String jwtSecret = "ems-esp";
|
String jwtSecret = "ems-esp";
|
||||||
@@ -54,6 +55,8 @@ class DummySettings {
|
|||||||
uint16_t publish_time_sensor = 10;
|
uint16_t publish_time_sensor = 10;
|
||||||
uint8_t bool_format = 1; // on off
|
uint8_t bool_format = 1; // on off
|
||||||
|
|
||||||
|
#define FACTORY_MQTT_MAX_TOPIC_LENGTH 128
|
||||||
|
|
||||||
static void read(DummySettings & settings, JsonObject & root){};
|
static void read(DummySettings & settings, JsonObject & root){};
|
||||||
static void read(DummySettings & settings){};
|
static void read(DummySettings & settings){};
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class Mqtt {
|
|||||||
enum Dallas_Format : uint8_t { SENSORID = 1, NUMBER };
|
enum Dallas_Format : uint8_t { SENSORID = 1, NUMBER };
|
||||||
enum HA_Climate_Format : uint8_t { CURRENT = 1, SETPOINT, ZERO };
|
enum HA_Climate_Format : uint8_t { CURRENT = 1, SETPOINT, ZERO };
|
||||||
|
|
||||||
static constexpr uint8_t MQTT_TOPIC_MAX_SIZE = FACTORY_MQTT_MAX_TOPIC_LENGTH; // note this should really match the user setting in mqttSettings.maxTopicLength
|
static constexpr uint8_t MQTT_TOPIC_MAX_SIZE = 128; // note this should really match the user setting in mqttSettings.maxTopicLength
|
||||||
|
|
||||||
static void on_connect();
|
static void on_connect();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user