mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[Bugfix] [I2C] Connection-check failure didn't correctly disable the plugin
This commit is contained in:
@@ -484,10 +484,14 @@ bool I2C_deviceCheck(uint8_t i2caddr,
|
||||
if (maxRetries > 0) {
|
||||
deviceCheckI2C[taskIndex]++;
|
||||
|
||||
// If the number of retries is reached, disable the device
|
||||
if (deviceCheckI2C[taskIndex] >= maxRetries) {
|
||||
// Disable temporarily as device check failed
|
||||
// FIXME TD-er: Should reschedule call to PLUGIN_INIT????
|
||||
Settings.TaskDeviceEnabled[taskIndex] = false; // If the number of retries is reached, disable the device
|
||||
struct EventStruct TempEvent(taskIndex);
|
||||
String dummy;
|
||||
|
||||
PluginCall(PLUGIN_EXIT, &TempEvent, dummy);
|
||||
# ifndef BUILD_NO_DEBUG
|
||||
addLog(LOG_LEVEL_ERROR, concat(F("I2C : Device doesn't respond for task: "), static_cast<int>(taskIndex + 1)));
|
||||
# endif // ifndef BUILD_NO_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user