mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
fix: restore reads the options the web UI ticks
The web UI sends the restore options as the form field "data". The param helpers looked up query parameters only, so /restore never saw them and restored the shades alone, since 3.0.0. The helpers now take a form field too. /restore uses an upload once, and drops the file when the options aren't JSON. e2e: test_restore.py, a probe that the field is read and, with --reboot, a settings-only round trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0ee52d6d9f
commit
3d45ba59c1
8 changed files with 97 additions and 18 deletions
|
|
@ -123,6 +123,11 @@ def test_reboot(request, host, token, connect, schema):
|
|||
uptime_before = uptime(schema, frames)
|
||||
assert is_ok(schema, op(c, schema, "reboot", {}))
|
||||
assert c.closed.wait(15), "the socket stayed open"
|
||||
wait_for_restart(host, token, schema, uptime_before)
|
||||
|
||||
|
||||
def wait_for_restart(host, token, schema, uptime_before):
|
||||
"""Waits until the device is back, and checks it restarted."""
|
||||
# The device closes its sockets just before it restarts, and may still
|
||||
# take a connection in between: that one never gets its hello.
|
||||
time.sleep(3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue