Merge remote-tracking branch 'origin/v3.4' into dev

This commit is contained in:
proddy
2022-01-23 17:56:52 +01:00
parent 02e2b51814
commit 77e1898512
538 changed files with 32282 additions and 38655 deletions

View File

@@ -120,3 +120,13 @@ int digitalRead(uint8_t pin) {
return LOW;
}
}
uint32_t analogReadMilliVolts(uint8_t pin) {
return 0;
}
void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation) {
}
void analogSetAttenuation(adc_attenuation_t attenuation) {
}

View File

@@ -53,9 +53,14 @@
#define snprintf snprintf_P // to keep backwards compatibility
void pinMode(uint8_t pin, uint8_t mode);
void digitalWrite(uint8_t pin, uint8_t value);
int digitalRead(uint8_t pin);
void pinMode(uint8_t pin, uint8_t mode);
void digitalWrite(uint8_t pin, uint8_t value);
int digitalRead(uint8_t pin);
uint32_t analogReadMilliVolts(uint8_t pin);
typedef enum { ADC_0db, ADC_2_5db, ADC_6db, ADC_11db } adc_attenuation_t;
void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation);
void analogSetAttenuation(adc_attenuation_t attenuation);
#define PROGMEM
#define PGM_P const char *
@@ -217,6 +222,4 @@ void yield(void);
void setup(void);
void loop(void);
#endif

View File

@@ -2,10 +2,15 @@
#define ESP8266React_h
#include <Arduino.h>
#include <ArduinoJson.h>
#include <AsyncJson.h>
#include <AsyncMqttClient.h>
#include <ESPAsyncWebServer.h>
#include <list>
#include <FS.h>
#include <SecurityManager.h>
#include <SecuritySettingsService.h>
@@ -26,39 +31,69 @@ class DummySettings {
bool shower_alert = false;
bool hide_led = false;
bool notoken_api = false;
uint8_t bool_format = 1; // on off
bool readonly_mode = false;
uint8_t bool_format = 1; // using "on" and "off"
uint8_t enum_format = 1;
uint8_t dallas_format = 1;
bool nosleep = false;
bool fahrenheit = false;
bool bandwidth20 = false;
bool telnet_enabled = false;
String board_profile = "CUSTOM";
bool trace_raw = false;
bool analog_enabled = true; // analog is enabled
int8_t weblog_level = 1;
uint8_t weblog_buffer = 50;
bool weblog_compact = true;
uint8_t rx_gpio = 0;
uint8_t tx_gpio = 0;
uint8_t dallas_gpio = 16; // to ensure its enabled
bool dallas_parasite = false;
uint8_t led_gpio = 0;
bool low_clock = false;
uint8_t pbutton_gpio = false;
uint8_t solar_maxflow = 30;
// MQTT
uint16_t publish_time = 10; // seconds
uint8_t mqtt_qos = 0;
bool mqtt_retain = false;
bool enabled = true;
uint8_t nested_format = 1; // 1=nested 2=single
uint8_t ha_climate_format = 1;
bool ha_enabled = true;
String base = "ems-esp";
bool send_response = true;
uint16_t publish_time = 10;
uint8_t mqtt_qos = 0;
bool mqtt_retain = false;
bool enabled = true;
uint8_t nested_format = 1; // 1=nested 2=single
String discovery_prefix = "homeassistant";
bool ha_enabled = true;
String base = "ems-esp";
bool publish_single = false;
bool send_response = true;
String host = "192.168.1.4";
uint16_t port = 1883;
String clientId = "ems-esp";
String username = "";
uint16_t keepAlive = 60;
bool cleanSession = false;
String hostname = "ems-esp";
String jwtSecret = "ems-esp";
String ssid = "ems-esp";
String password = "ems-esp";
String localIP = "";
String gatewayIP = "";
String subnetMask = "";
bool staticIPConfig = false;
String dnsIP1 = "";
String dnsIP2 = "";
String board_profile = "CUSTOM";
uint16_t publish_time_boiler = 10;
uint16_t publish_time_thermostat = 10;
uint16_t publish_time_solar = 10;
uint16_t publish_time_mixer = 10;
uint16_t publish_time_other = 10;
uint16_t publish_time_sensor = 10;
bool enableIPv6 = false;
String hostname = "ems-esp";
String jwtSecret = "ems-esp";
String ssid = "ems-esp";
String password = "ems-esp";
String localIP = "";
String gatewayIP = "";
String subnetMask = "";
bool staticIPConfig = false;
String dnsIP1 = "";
String dnsIP2 = "";
bool enableIPv6 = false;
uint8_t phy_type = 0;
uint8_t eth_power = 0; // 0 means -1
uint8_t eth_phy_addr = 0;
uint8_t eth_clock_mode = 0;
#define FACTORY_MQTT_MAX_TOPIC_LENGTH 128

View File

@@ -64,4 +64,4 @@ class FSPersistence {
}
};
#endif // end FSPersistence
#endif

View File

@@ -129,4 +129,4 @@ class HttpEndpoint : public HttpGetEndpoint<T>, public HttpPostEndpoint<T> {
}
};
#endif // end HttpEndpoint
#endif

View File

@@ -167,6 +167,10 @@ class WiFiClass {
char * localIP() {
return nullptr;
}
wl_status_t status() {
return WL_CONNECTED;
}
};
class ETHClass {

View File

@@ -80,4 +80,4 @@ class SecurityManager {
virtual ArJsonRequestHandlerFunction wrapCallback(ArJsonRequestHandlerFunction onRequest, AuthenticationPredicate predicate) = 0;
};
#endif // end SecurityManager_h
#endif

View File

@@ -102,5 +102,5 @@ class SecuritySettingsService : public SecurityManager {
ArJsonRequestHandlerFunction wrapCallback(ArJsonRequestHandlerFunction onRequest, AuthenticationPredicate predicate);
};
#endif // end FT_ENABLED(FT_SECURITY)
#endif // end SecuritySettingsService_h
#endif
#endif

View File

@@ -17,8 +17,9 @@
enum class StateUpdateResult {
CHANGED = 0, // The update changed the state and propagation should take place if required
UNCHANGED, // The state was unchanged, propagation should not take place
ERROR // There was a problem updating the state, propagation should not take place
CHANGED_RESTART, // The update changed the state and the service should be restarted
UNCHANGED, // The state was unchanged, propagation should not take place
ERROR // There was a problem updating the state, propagation should not take place
};
template <typename T>
@@ -149,4 +150,4 @@ class StatefulService {
std::list<StateUpdateHandlerInfo_t> _updateHandlers;
};
#endif // end StatefulService_h
#endif