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
This commit is contained in:
parent
4d510688ab
commit
bc384f6b9c
@ -1640,10 +1640,15 @@ class TasmotaDiscovery:
|
|||||||
self.logger.error(f"{name}: Failed to set {setting}")
|
self.logger.error(f"{name}: Failed to set {setting}")
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
self.logger.error(f"{name}: Error updating {setting}: {str(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
|
# Apply console settings
|
||||||
console_updated = self.apply_console_settings(ip, name, with_retry)
|
console_updated = self.apply_console_settings(ip, name, with_retry)
|
||||||
|
|
||||||
# Reboot the device if requested
|
# Reboot the device if requested
|
||||||
if reboot:
|
if reboot:
|
||||||
save_url = f"http://{ip}/cm?cmnd=Restart%201"
|
save_url = f"http://{ip}/cm?cmnd=Restart%201"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user