clear list on autodetect

This commit is contained in:
Paul
2019-06-08 22:35:37 +02:00
parent 82ca347d44
commit 58a244ab2a
4 changed files with 10 additions and 1 deletions

View File

@@ -945,7 +945,7 @@ void MyESP::showSystemStats() {
myDebug_P(PSTR(" [MEM] Firmware size: %d"), ESP.getSketchSize());
myDebug_P(PSTR(" [MEM] Max OTA size: %d"), (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000);
myDebug_P(PSTR(" [MEM] OTA Reserved: %d"), 4 * SPI_FLASH_SEC_SIZE);
myDebug_P(PSTR(" [MEM] Free Heap: %d"), ESP.getFreeHeap());
//myDebug_P(PSTR(" [MEM] Free Heap: %d"), ESP.getFreeHeap());
myDebug_P(PSTR(""));
}

View File

@@ -964,6 +964,7 @@ void startDeviceScan() {
regularUpdatesTimer.detach();
publishSensorValuesTimer.detach();
scanDevices_count = 1; // starts at 1
ems_clearDeviceList(); // empty the current list
ems_setLogging(EMS_SYS_LOGGING_NONE);
myDebug_P(PSTR("Starting a deep EMS device scan. This can take up to 2 minutes. Please wait..."));
scanThermostat.attach_ms(SCANDEVICES_TIME, do_scanDevices);

View File

@@ -1529,6 +1529,13 @@ void _process_RCTime(_EMS_RxTelegram * EMS_RxTelegram) {
EMS_Thermostat.year = _toByte(0);
}
/*
* Clear devices list
*/
void ems_clearDeviceList() {
Devices.clear();
}
/*
* add an EMS device to our list of detected devices
*/

View File

@@ -314,6 +314,7 @@ void ems_setWarmWaterModeComfort(uint8_t comfort);
bool ems_checkEMSBUSAlive();
void ems_setModels();
void ems_setTxDisabled(bool b);
void ems_clearDeviceList();
void ems_getThermostatValues();
void ems_getBoilerValues();