Remove std::string as the model id and use decoder enum. (#1143)

* Remove std::string as the model id and use decoder enum.

* Update decoder version

* Check model id is in decoder range when launching discovery.

* Add BLEconnect enum MIN/MAX
This commit is contained in:
h2zero authored and GitHub committed 2022-01-24 20:09:15 -06:00
1 parent 91ab8dcdf1
commit e838d3cee0
5 files changed
+67 -44

No files matched your search

-6
View File
@@ -1154,9 +1154,7 @@ void setup_wifimanager(bool reset_settings) {
WiFiManagerParameter custom_mqtt_pass("pass", "mqtt pass", mqtt_pass, parameters_size * 2);
WiFiManagerParameter custom_mqtt_topic("topic", "mqtt base topic", mqtt_topic, mqtt_topic_max_size);
WiFiManagerParameter custom_mqtt_secure("secure", "mqtt secure", "1", 1, mqtt_secure ? "type=\"checkbox\" checked" : "type=\"checkbox\"");
# ifdef ESP32 // not enough memory on ESP8266
WiFiManagerParameter custom_mqtt_cert("cert", "mqtt broker cert", mqtt_cert.c_str(), 2048);
# endif
WiFiManagerParameter custom_gateway_name("name", "gateway name", gateway_name, parameters_size * 2);
# endif
//WiFiManager
@@ -1185,9 +1183,7 @@ void setup_wifimanager(bool reset_settings) {
wifiManager.addParameter(&custom_mqtt_user);
wifiManager.addParameter(&custom_mqtt_pass);
wifiManager.addParameter(&custom_mqtt_secure);
# ifdef ESP32 // not enough memory on ESP8266
wifiManager.addParameter(&custom_mqtt_cert);
# endif
wifiManager.addParameter(&custom_gateway_name);
wifiManager.addParameter(&custom_mqtt_topic);
# endif
@@ -1241,7 +1237,6 @@ void setup_wifimanager(bool reset_settings) {
strcpy(gateway_name, custom_gateway_name.getValue());
mqtt_secure = *custom_mqtt_secure.getValue();
# ifdef ESP32 // not enough memory on ESP8266
int cert_len = strlen(custom_mqtt_cert.getValue());
if (cert_len) {
char* cert_in = (char*)custom_mqtt_cert.getValue();
@@ -1259,7 +1254,6 @@ void setup_wifimanager(bool reset_settings) {
mqtt_cert = cert_begin;
}
# endif
# endif
//save the custom parameters to FS
saveMqttConfig();