mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
feat: edit ops and the reads their forms need, for socket protocol 2
The edit routes become ops 26-44 (addRoom ... groupSortOrder): ProtoEdits turns an op's payload into the route's request, full names and real booleans, and loop() applies it with applyModelEdit() as the route does. The reply goes to the client that sent it, with an add's new id, or the route's reason and a shade's validation code; the HTTP routes keep sending requestResult. getNextRoom, getNextShade, getNextGroup and groupOptions (45-48) are answered by loop() from the shade model, through a new LoopQueue item. Messages that arrive in pieces, a frame over one TCP segment or several frames, are put back together by ProtoAssembly: one at a time across clients, up to 4 KB, in a buffer held only while one is on its way. A message in pieces is now told from its first frame's opcode, which also stops a fragmented message's last frame drawing a second reply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ea973809e2
commit
77237111ea
22 changed files with 851 additions and 22 deletions
|
|
@ -17,6 +17,7 @@ def pytest_addoption(parser):
|
|||
parser.addoption("--record", action="store_true", help="save what the device sends to test/fixtures/proto2")
|
||||
parser.addoption("--radio", action="store_true", help="also run the tests that send commands on air")
|
||||
parser.addoption("--shade", type=int, default=None, help="with --radio: the id of the shade the commands may move")
|
||||
parser.addoption("--edit", action="store_true", help="also run the edits that change the shade model, then undo them")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
@ -95,3 +96,11 @@ def radio_shade(request):
|
|||
if shade is None:
|
||||
pytest.skip("--radio needs --shade <id>, a shade that may move")
|
||||
return shade
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def editing(request):
|
||||
"""For tests that change the shade model and change it back, or a skip."""
|
||||
if not request.config.getoption("--edit"):
|
||||
pytest.skip("changes the shade model and back: pass --edit")
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue