Handle fails more properly
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user