mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-01-01 04:53:35 +05:00
Compare commits
2 Commits
fcf7d61ca5
...
6a9bd9673a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a9bd9673a | ||
|
|
5aea80e630 |
@@ -119,7 +119,10 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cleanDallasInstances() {
|
void cleanDallasInstances() {
|
||||||
for (auto& [gpio, instance] : this->dallasInstances) {
|
// for (auto& [gpio, instance] : this->dallasInstances) {
|
||||||
|
auto it = this->dallasInstances.begin();
|
||||||
|
while (it != this->dallasInstances.end()) {
|
||||||
|
auto gpio = it->first;
|
||||||
bool instanceUsed = false;
|
bool instanceUsed = false;
|
||||||
|
|
||||||
for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) {
|
for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) {
|
||||||
@@ -135,8 +138,8 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!instanceUsed) {;
|
if (!instanceUsed) {
|
||||||
this->dallasInstances.erase(gpio);
|
it = this->dallasInstances.erase(it);
|
||||||
this->owInstances.erase(gpio);
|
this->owInstances.erase(gpio);
|
||||||
this->dallasSearchTime.erase(gpio);
|
this->dallasSearchTime.erase(gpio);
|
||||||
this->dallasPolling.erase(gpio);
|
this->dallasPolling.erase(gpio);
|
||||||
@@ -145,6 +148,8 @@ protected:
|
|||||||
Log.sinfoln(FPSTR(L_SENSORS_DALLAS), F("Stopped on GPIO %hhu"), gpio);
|
Log.sinfoln(FPSTR(L_SENSORS_DALLAS), F("Stopped on GPIO %hhu"), gpio);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,14 +152,14 @@ struct Settings {
|
|||||||
Sensors::Settings sensorsSettings[SENSORS_AMOUNT] = {
|
Sensors::Settings sensorsSettings[SENSORS_AMOUNT] = {
|
||||||
{
|
{
|
||||||
false,
|
false,
|
||||||
"Indoor temp",
|
"Outdoor temp",
|
||||||
Sensors::Purpose::OUTDOOR_TEMP,
|
Sensors::Purpose::OUTDOOR_TEMP,
|
||||||
Sensors::Type::DALLAS_TEMP,
|
Sensors::Type::DALLAS_TEMP,
|
||||||
DEFAULT_SENSOR_OUTDOOR_GPIO
|
DEFAULT_SENSOR_OUTDOOR_GPIO
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
false,
|
false,
|
||||||
"Outdoor temp",
|
"Indoor temp",
|
||||||
Sensors::Purpose::INDOOR_TEMP,
|
Sensors::Purpose::INDOOR_TEMP,
|
||||||
Sensors::Type::DALLAS_TEMP,
|
Sensors::Type::DALLAS_TEMP,
|
||||||
DEFAULT_SENSOR_INDOOR_GPIO
|
DEFAULT_SENSOR_INDOOR_GPIO
|
||||||
|
|||||||
Reference in New Issue
Block a user