diff --git a/console_settings.py b/console_settings.py index a2fb72f..376da2d 100644 --- a/console_settings.py +++ b/console_settings.py @@ -165,8 +165,14 @@ class ConsoleSettingsManager: time.sleep(0.5) # Brief delay between commands - # Send the actual command - escaped_command = command.replace(' ', '%20') + # Send the actual command - properly URL encode + from urllib.parse import quote + # Split command into param and value, then URL encode the value part + parts = command.split(None, 1) + if len(parts) == 2: + escaped_command = parts[0] + '%20' + quote(parts[1], safe='') + else: + escaped_command = command.replace(' ', '%20') result, success = retry_command( lambda: send_tasmota_command(device_ip, escaped_command, timeout=5, logger=self.logger),