Skip to content

Commit

Permalink
hot fix issue on stype return -1 with new sensorlib
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsaturn committed Nov 16, 2020
1 parent ed9310a commit 1ada473
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/configlib/ConfigApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void ConfigApp::reload() {
alt = preferences.getFloat("alt", 0);
spd = preferences.getFloat("spd", 0);
stime = preferences.getInt("stime", 5);
stype = preferences.getInt("stype", -1);
stype = preferences.getInt("stype", 0);

preferences.end();
}
Expand All @@ -49,7 +49,7 @@ String ConfigApp::getCurrentConfig() {
preferences.begin(_app_name, false);
doc["dname"] = preferences.getString("dname", ""); // device or station name
doc["stime"] = preferences.getInt("stime", 5); // sensor measure time
doc["stype"] = preferences.getInt("stype", -1); // sensor type { Honeywell, Panasonic, Sensirion };
doc["stype"] = preferences.getInt("stype", 0); // sensor type { Honeywell, Panasonic, Sensirion };
doc["wenb"] = preferences.getBool("wifiEnable", false); // wifi on/off
doc["ssid"] = preferences.getString("ssid", ""); // influxdb database name
doc["ienb"] = preferences.getBool("ifxEnable", false); // ifxdb on/off
Expand Down Expand Up @@ -250,7 +250,7 @@ bool ConfigApp::save(const char *json) {

if (doc.containsKey("dname")) return saveDeviceName(doc["dname"] | "");
if (doc.containsKey("stime")) return saveSampleTime(doc["stime"] | 0);
if (doc.containsKey("stype")) return saveSensorType(doc["stype"] | -1);
if (doc.containsKey("stype")) return saveSensorType(doc["stype"] | 0);
if (doc.containsKey("ifxdb")) return saveInfluxDb(doc["ifxdb"] | "", doc["ifxip"] | "", doc["ifxpt"] | 0);
if (doc.containsKey("ssid")) return saveWifi(doc["ssid"] | "", doc["pass"] | "");
if (doc.containsKey("apiusr")) return saveAPI(doc["apiusr"] | "", doc["apipss"] | "", doc["apisrv"] | "", doc["apiuri"] | "", doc["apiprt"] | 0);
Expand Down

0 comments on commit 1ada473

Please sign in to comment.