Исправляем ошибки компиляции при переходе на новое ядро

This commit is contained in:
2022-09-14 20:36:38 +03:00
parent 8ce79687bc
commit 818824c378
5 changed files with 83 additions and 83 deletions

View File

@@ -53,28 +53,28 @@ class Dht1122h : public IoTItem {
};
void* getAPI_Dht1122(String subtype, String param) {
// if (subtype == F("Dht1122t") || subtype == F("Dht1122h")) {
// int pin;
// String senstype;
// jsonRead(param, "pin", pin);
// jsonRead(param, "senstype", senstype);
//
// if (dhts.find(pin) == dhts.end()) {
// dhts[pin] = new DHTesp();
//
// if (senstype == "dht11") {
// dhts[pin]->setup(pin, DHTesp::DHT11);
// } else if (senstype == "dht22") {
// dhts[pin]->setup(pin, DHTesp::DHT22);
// }
// }
//
// if (subtype == F("Dht1122t")) {
// return new Dht1122t(dhts[pin], param);
// } else if (subtype == F("Dht1122h")) {
// return new Dht1122h(dhts[pin], param);
// }
//} else {
if (subtype == F("Dht1122t") || subtype == F("Dht1122h")) {
int pin;
String senstype;
jsonRead(param, "pin", pin);
jsonRead(param, "senstype", senstype);
if (dhts.find(pin) == dhts.end()) {
dhts[pin] = new DHTesp();
if (senstype == "dht11") {
dhts[pin]->setup(pin, DHTesp::DHT11);
} else if (senstype == "dht22") {
dhts[pin]->setup(pin, DHTesp::DHT22);
}
}
if (subtype == F("Dht1122t")) {
return new Dht1122t(dhts[pin], param);
} else if (subtype == F("Dht1122h")) {
return new Dht1122h(dhts[pin], param);
}
}
return nullptr;
//}
}