From bc384f6b9cebc61baa1338f6b4d8125b8ffd8ffa Mon Sep 17 00:00:00 2001 From: Mike Geppert Date: Tue, 28 Oct 2025 08:54:17 +0000 Subject: [PATCH] Fix Issue #3: Add delay after MQTT configuration before console settings - Add 1-second delay after MQTT changes to allow device to process - Only delays when MQTT settings were actually updated - Prevents intermittent failures when applying console settings - Device needs time to process MQTT reconnection before accepting new commands --- TasmotaManager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TasmotaManager.py b/TasmotaManager.py index 5517012..6c87b15 100755 --- a/TasmotaManager.py +++ b/TasmotaManager.py @@ -1640,10 +1640,15 @@ class TasmotaDiscovery: self.logger.error(f"{name}: Failed to set {setting}") except requests.exceptions.RequestException as e: self.logger.error(f"{name}: Error updating {setting}: {str(e)}") - + + # Add delay after MQTT configuration to allow device to process changes + if mqtt_updated: + self.logger.debug(f"{name}: Waiting for device to process MQTT changes...") + time.sleep(1.0) + # Apply console settings console_updated = self.apply_console_settings(ip, name, with_retry) - + # Reboot the device if requested if reboot: save_url = f"http://{ip}/cm?cmnd=Restart%201"