Merge branch 'ver4dev'

This commit is contained in:
2022-02-22 21:21:48 +03:00
parent a4648fd075
commit bd4753f2c9
7 changed files with 62 additions and 52 deletions

View File

@@ -55,18 +55,20 @@ class Bmp280p : public IoTItem {
void* getAPI_Bmp280(String subtype, String param) {
String addr;
jsonRead(param, "addr", addr);
if (subtype == F("Bmp280t") || subtype == F("Bmp280p")) {
String addr;
jsonRead(param, "addr", addr);
if (bmps.find(addr) == bmps.end()) {
bmps[addr] = new Adafruit_BMP280();
bmps[addr]->begin(hexStringToUint8(addr));
}
if (bmps.find(addr) == bmps.end()) {
bmps[addr] = new Adafruit_BMP280();
bmps[addr]->begin(hexStringToUint8(addr));
}
if (subtype == F("Bmp280t")) {
return new Bmp280t(bmps[addr], param);
} else if (subtype == F("Bmp280p")) {
return new Bmp280p(bmps[addr], param);
if (subtype == F("Bmp280t")) {
return new Bmp280t(bmps[addr], param);
} else if (subtype == F("Bmp280p")) {
return new Bmp280p(bmps[addr], param);
}
} else {
return nullptr;
}