Handle fails more properly

This commit is contained in:
Pierre HUBERT 2024-09-28 16:35:50 +02:00
parent 58abf4ec9b
commit ce8427b0aa

View File

@ -176,7 +176,7 @@ void app_main(void)
if (!res)
{
fails += 1;
ESP_LOGE(TAG, "Failed to synchronise device!");
ESP_LOGE(TAG, "Failed to synchronise device! (number=%d)", fails);
// Safely turn off all relays after a given number of failures
if (fails > 5)
@ -197,6 +197,8 @@ void app_main(void)
continue;
}
fails = 0;
// TODO : apply sync
sync_response_print(res);