Move S7CommPlus into s7/ package, simplify to 2-layer architecture#662
Open
gijzelaerr wants to merge 4 commits intomasterfrom
Open
Move S7CommPlus into s7/ package, simplify to 2-layer architecture#662gijzelaerr wants to merge 4 commits intomasterfrom
gijzelaerr wants to merge 4 commits intomasterfrom
Conversation
Instead of probing data operations and falling back on ERROR2, properly complete the V1 session setup by parsing ServerSessionVersion (attribute 306) from the CreateObject response and echoing it back via SetMultiVariables. This should fix the ERROR2 (0x05A9) rejections from real S7-1200/1500 PLCs with firmware v4.0+. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collapse 3 layers (snap7, snap7.s7commplus, s7) into 2: - snap7/ stays untouched as legacy S7 protocol - s7/ is the new unified frontend with S7CommPlus + legacy fallback Key changes: - Move all S7CommPlus protocol code from snap7/s7commplus/ to s7/ - Remove duplicated fallback logic — now lives only in s7.Client - Pure S7CommPlus clients (_s7commplus_client.py) have no fallback - s7.Client tries S7CommPlus first, falls back to snap7.Client - Rename tests: test_s7commplus_* → test_s7_* - Update all imports, docs, tooling (mypy, ruff, tox) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts in s7/_s7commplus_client.py and s7/_s7commplus_async_client.py — keep our refactored versions which already include the session setup fix from #661 but without the fallback logic (now owned by s7.Client). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- s7.Client.db_write() and s7.AsyncClient.db_write() now return int (0) matching snap7.Client behavior - s7.AsyncClient.disconnect() now returns int (0) matching snap7.AsyncClient - doc/introduction.rst: explain two-package architecture (snap7 vs s7) - doc/connecting.rst: add tip about s7 package for S7-1200/1500 - Keep S7CommPlus marked as experimental throughout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
snap7/s7commplus/into a new top-levels7/packagesnap7/(legacy, untouched) ands7/(unified frontend)s7.Clienttries S7CommPlus, falls back tosnap7.ClientHow it works
What changed
snap7/s7commplus/deleted entirelys7/s7/_s7commplus_client.py) stripped of fallback logics7.Client/s7.AsyncClientown the fallback decisiontest_s7commplus_*→test_s7_*with updated importsSupersedes #657 and #661.
Test plan
🤖 Generated with Claude Code