feat: OTA firmware update per device with auto config backup
- Upload .bin firmware files via web UI - Update individual devices (button per device in table) - Auto config backup before each update - Shows current version vs available firmware - Firmware file management (upload/delete) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,3 +69,19 @@ def restore_wled_config(hostname, config_json):
|
||||
return r.status_code == 200, f"{r.status_code} {r.reason}"
|
||||
except requests.exceptions.RequestException as e:
|
||||
return False, str(e)
|
||||
|
||||
|
||||
def ota_update_wled(hostname, firmware_path):
|
||||
"""Push firmware binary to WLED device via OTA. Returns (success, message)."""
|
||||
try:
|
||||
with open(firmware_path, "rb") as f:
|
||||
r = requests.post(
|
||||
f"http://{hostname}/update",
|
||||
files={"update": ("firmware.bin", f, "application/octet-stream")},
|
||||
timeout=120,
|
||||
)
|
||||
if r.status_code == 200:
|
||||
return True, "Update erfolgreich, Geraet startet neu"
|
||||
return False, f"{r.status_code} {r.reason}"
|
||||
except requests.exceptions.RequestException as e:
|
||||
return False, str(e)
|
||||
|
||||
Reference in New Issue
Block a user