-
Notifications
You must be signed in to change notification settings - Fork 2
Development and contributions
At first - thanks for supporting this project, much appreciated! To keep things clean and avoid chaos, please follow this simple branch workflow if you want help us developing the integration further.
%%{init: {"themeCSS": ".edgeLabel, .edgeLabel p { font-size: 12px !important; line-height: 1.2 !important; background-color: transparent !important; } .labelBkg { background-color: transparent !important; } .edgeLabel rect { fill: transparent !important; opacity: 0 !important; }"}}%%
flowchart TB
main[":main<br/>Holds current release<br/><red>Locked - *NO* PR's!</red>"]
develop[":develop<br/>Central mergepoint<br/>Fork from here"]
main ~~~ develop
develop -.->|New release version:<br/>FF merge only.| main
develop_tom[":develop_tom<br/>working branch<br/>my changes go here"]
develop_you[":your_branch_name<br/>create it from :develop<br/>your changes go here"]
develop_someone[":develop_someone<br/>working branch<br/>changes go here"]
develop_sometwo[":develop_sometwo<br/>working branch<br/>changes go here"]
develop <-.->|FF merge| develop_tom
develop <-.->|Your PR's| develop_you
develop <-.->|PR's| develop_someone
develop <-.->|PR's| develop_sometwo
style main stroke:red,color:red
style develop stroke:green,color:green
style develop_you stroke:green,color:green
- personal maintainer working branch,
- frequent local changes,
- no automatic CI required on every push,
- incomplete work may exist temporarily,
- local checks are run manually when a coherent block is ready.
- shared integration and beta branch,
- automatic CI runs on pushes and pull requests,
- external pull requests must target this branch,
- accepted maintainer work is integrated here,
- should remain releasable after successful checks.
- current release branch,
- protected by repository rules,
- only the repository's local
developbranch may be the source of a pull request, - direct pushes and force pushes should be blocked,
- releases are created from this branch.
-
Fork this repository first
Please fork the repository and do your work in your own copy. -
Create your own working branch
Create your branch based ondevelop(select develop branch, then create your own working branch from it).git checkout develop git pull git checkout -b develop_yourname -
Keep your branch up to date
Before opening or updating a PR, please sync your branch with the latestdevelop. -
Always create your pull request against
develop
All new features, fixes and experiments must go intodevelopfirst. Themainbranch is configured to auto-reject direct PR's. -
Please enable editable pull requests
When opening the PR, keep Allow edits by maintainers enabled. This makes it much easier to help with small fixes, cleanup or merge conflicts. -
Keep your branch focused
One topic per pull request is much easier to review than one huge mixed change. -
Short description helps a lot
Please briefly describe what you changed, why you changed it, and whether you already tested it.
And again: Thank you for contributing!!!
- Python 3.12 or newer
- a local source checkout of
trovis-modbus - development dependencies for tests, Ruff, and package builds
- optionally, a local checkout of
modbus-connectionfor coordinated changes
uv sync
uv run pytest
uvx prek run --all-filesInstall the package in editable mode:
python -m pip install -e .
python -m pip install "pytest>=8" "pytest-asyncio>=0.24" ruff buildRun the test suite:
script/libtest.shRun all local quality and build checks:
script/libcheck.shThe repository scripts resolve the repository root themselves and can be called from any working directory.
The test suite uses the modbus-connection in-memory pytest backend. Normal unit
tests do not require:
- a physical TROVIS controller,
- a serial adapter,
- a network gateway,
- an external Modbus server.
Current test areas include:
- canonical catalog parity,
- model-specific catalog and range selection,
- per-model sensor capabilities,
- hydronic system definitions and Rk roles,
- sensor-variant resolution,
- register and coil metadata,
- grouped read behavior and block boundaries,
- signed and scaled conversion,
- invalid-value handling,
- model and sensor probing,
- operating-mode writes,
- control-level behavior,
- operational datapoints,
- date and time decoding and encoding,
- write ordering and preconditions,
- enum options,
- buffer-tank and solar availability,
- command-line query behavior.
The development baseline should pass the complete suite with only explicitly documented expected skips.
The test script:
- checks for the configured local
modbus-connectionsource, - installs pytest dependencies when required,
- adds both source trees to
PYTHONPATH, - runs pytest from the repository root.
The complete local check performs:
- Ruff formatting check,
- Ruff lint,
- source and test compilation,
- the complete pytest suite,
- source distribution and wheel build.
Run this script before moving a completed development block to develop.
The project development environment may use a local checkout of
modbus-connection.
The default source path used by script/libtest.sh is:
/config/dev/modbus-connection/src
Override it with:
MODBUS_CONNECTION_SRC=/another/path script/libtest.shA custom Python interpreter can be selected with:
PYTHON_BIN=/path/to/python script/libtest.shThis local setup is useful for coordinated development. GitHub CI intentionally
installs the package normally and verifies compatibility with the published
modbus-connection dependency.
Before moving a completed block to develop:
script/libcheck.sh
git status
git add .
git commit -m "Describe the completed block"
git pushThen integrate develop_tom into develop using the repository's chosen
linear-history workflow.
After integration:
- wait for the GitHub CI result on
develop, - correct failures on the working branch or a dedicated fix branch,
- keep
developas the tested shared baseline.
External contributions should follow this path:
- Fork the repository.
- Create a focused branch from the current
developbranch. - Make one coherent and testable change.
- Add or update tests.
- Run the local checks.
- Open a pull request against
develop. - Respond to review feedback without changing the pull request target to
main.
Pull requests from forks directly to main are rejected by the branch guard.
A contribution should avoid mixing unrelated refactoring, new datapoints, behavior changes, and documentation cleanup in one large change unless they are inseparable parts of the same feature.
When adding a datapoint or behavior:
- Prefer current official manufacturer documentation.
- Keep manufacturer references visible in the catalog.
- Add neutral metadata in the library.
- Preserve model, block, system-code, function, and parameter restrictions.
- Do not make a field writable without a verified write path.
- Add tests for conversion, metadata, availability, and behavior.
- Avoid duplicating presentation logic from one application.
- Prefer native typed values over raw display-oriented values.
- Prefer direct controller values over reconstructed estimates.
- Do not resolve ambiguous sensor roles from plausible measured values.
- Keep changes small enough to review, but complete enough to test as one coherent feature.
The CI workflow runs on:
- pushes to
develop, - pushes to
main, - pull requests targeting
develop.
Its quality job performs:
checkout
setup Python
install package and test tools
ruff format --check
ruff check
compileall
pytest
build sdist and wheel
The CI runner installs the project normally and therefore verifies compatibility
with the publicly available modbus-connection dependency rather than the
maintainer's local source checkout.
A separate workflow runs on pull requests targeting main. It rejects the pull
request unless:
- the source branch is
develop, and - the source branch belongs to the same repository.
The GitHub ruleset should make the relevant guard and branch-protection checks
required before merging to main.
The intended release sequence is:
- Finish and test changes on
develop_tom. - Run
script/libcheck.sh. - Integrate the completed block into
develop. - Wait for the GitHub CI result.
- Update detailed wiki documentation where necessary.
- Prepare release notes for release-specific changes.
- Update the README only when the general project scope, supported controller list, or top-level positioning changes.
- Open a pull request from
developtomain. - Confirm the branch guard and repository protection checks.
- Merge the pull request.
- Create a GitHub release and tag.
- Let the publish workflow build and publish the package.
The source tree keeps the development version at 0.0.0. The publish workflow
replaces it with the GitHub release tag for the package build and publishes the
result through the configured PyPI environment.
The project follows semantic versioning in principle:
- patch release for compatible fixes,
- minor release for compatible new public features,
- major release for intentional breaking API changes.
Examples of compatible additions that normally fit a minor release include:
- new typed datapoints,
- new enums,
- new metadata,
- new optional subsystems,
- new model or system definitions,
- additional derived properties,
- new public helper methods that do not break existing callers.
A rename or removal of a public attribute, a changed public value type, or an intentional behavior change that breaks callers requires explicit migration notes and may require a major release.
Documentation is divided by purpose:
| Location | Purpose | Normal update frequency |
|---|---|---|
README.md |
Stable overview, data categories, supported controllers, wiki link | Only when the general project description changes |
| Wiki | Detailed architecture, behavior, examples, development, and limitations | Whenever technical behavior or workflow changes |
| Release notes | Changes in one specific published version | Every release |
| Code comments and docstrings | Local implementation intent and non-obvious rules | With the corresponding code change |
Do not copy a release changelog into the README. Do not leave detailed usage or contribution instructions only in the README when they belong in the wiki.
Disclaimer: Any information on this wiki is informal advice only. It is not supported nor endorsed by Samson, Sauter, YADOS, Pewo or any other equipment maker. There is no warranty expressed or implied: you take sole responsibility for everything you do with your heating controller.