py-opendisplay 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. py_opendisplay-1.0.0/.github/workflows/lint.yml +25 -0
  2. py_opendisplay-1.0.0/.github/workflows/release.yml +58 -0
  3. py_opendisplay-1.0.0/.github/workflows/test.yml +40 -0
  4. py_opendisplay-1.0.0/.gitignore +207 -0
  5. py_opendisplay-1.0.0/.release-please-config.json +20 -0
  6. py_opendisplay-1.0.0/.release-please-manifest.json +3 -0
  7. py_opendisplay-1.0.0/CHANGELOG.md +82 -0
  8. py_opendisplay-1.0.0/LICENSE +21 -0
  9. py_opendisplay-1.0.0/PKG-INFO +301 -0
  10. py_opendisplay-1.0.0/README.md +265 -0
  11. py_opendisplay-1.0.0/pyproject.toml +77 -0
  12. py_opendisplay-1.0.0/src/opendisplay/__init__.py +81 -0
  13. py_opendisplay-1.0.0/src/opendisplay/device.py +574 -0
  14. py_opendisplay-1.0.0/src/opendisplay/discovery.py +74 -0
  15. py_opendisplay-1.0.0/src/opendisplay/encoding/__init__.py +17 -0
  16. py_opendisplay-1.0.0/src/opendisplay/encoding/bitplanes.py +71 -0
  17. py_opendisplay-1.0.0/src/opendisplay/encoding/compression.py +53 -0
  18. py_opendisplay-1.0.0/src/opendisplay/encoding/dithering.py +658 -0
  19. py_opendisplay-1.0.0/src/opendisplay/encoding/images.py +164 -0
  20. py_opendisplay-1.0.0/src/opendisplay/exceptions.py +38 -0
  21. py_opendisplay-1.0.0/src/opendisplay/models/__init__.py +48 -0
  22. py_opendisplay-1.0.0/src/opendisplay/models/advertisement.py +58 -0
  23. py_opendisplay-1.0.0/src/opendisplay/models/capabilities.py +17 -0
  24. py_opendisplay-1.0.0/src/opendisplay/models/config.py +428 -0
  25. py_opendisplay-1.0.0/src/opendisplay/models/enums.py +165 -0
  26. py_opendisplay-1.0.0/src/opendisplay/models/firmware.py +19 -0
  27. py_opendisplay-1.0.0/src/opendisplay/protocol/__init__.py +39 -0
  28. py_opendisplay-1.0.0/src/opendisplay/protocol/commands.py +157 -0
  29. py_opendisplay-1.0.0/src/opendisplay/protocol/config_parser.py +437 -0
  30. py_opendisplay-1.0.0/src/opendisplay/protocol/responses.py +143 -0
  31. py_opendisplay-1.0.0/src/opendisplay/transport/__init__.py +7 -0
  32. py_opendisplay-1.0.0/src/opendisplay/transport/connection.py +226 -0
  33. py_opendisplay-1.0.0/tests/conftest.py +86 -0
  34. py_opendisplay-1.0.0/tests/fixtures/real_protocol_data/02_read_firmware_command.bin +0 -0
  35. py_opendisplay-1.0.0/tests/fixtures/real_protocol_data/02_read_firmware_response.bin +0 -0
  36. py_opendisplay-1.0.0/tests/fixtures/real_protocol_data/03_upload_start_uncompressed_command.bin +0 -0
  37. py_opendisplay-1.0.0/tests/fixtures/real_protocol_data/04_data_chunk_command.bin +0 -0
  38. py_opendisplay-1.0.0/tests/fixtures/real_protocol_data/05_upload_end_command.bin +0 -0
  39. py_opendisplay-1.0.0/tests/unit/test_models_advertisement.py +77 -0
  40. py_opendisplay-1.0.0/tests/unit/test_module_enums.py +206 -0
  41. py_opendisplay-1.0.0/tests/unit/test_protocol_commands.py +161 -0
  42. py_opendisplay-1.0.0/tests/unit/test_protocol_responses.py +217 -0
  43. py_opendisplay-1.0.0/uv.lock +1023 -0
@@ -0,0 +1,25 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ name: Lint
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v3
17
+
18
+ - name: Set up Python
19
+ run: uv python install 3.11
20
+
21
+ - name: Install dependencies
22
+ run: uv sync --extra dev
23
+
24
+ - name: Run ruff
25
+ run: uv run ruff check .
@@ -0,0 +1,58 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+ id-token: write # For PyPI trusted publishing
12
+
13
+ jobs:
14
+ release-please:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: googleapis/release-please-action@v4
18
+ id: release
19
+ with:
20
+ release-type: python
21
+ package-name: py-opendisplay
22
+ bump-minor-pre-major: true
23
+ bump-patch-for-minor-pre-major: true
24
+
25
+ # The following steps only run if a release was created
26
+ - name: Checkout code
27
+ if: ${{ steps.release.outputs.release_created }}
28
+ uses: actions/checkout@v4
29
+
30
+ - name: Set up Python
31
+ if: ${{ steps.release.outputs.release_created }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "3.11"
35
+
36
+ - name: Install uv
37
+ if: ${{ steps.release.outputs.release_created }}
38
+ uses: astral-sh/setup-uv@v4
39
+
40
+ - name: Install dependencies
41
+ if: ${{ steps.release.outputs.release_created }}
42
+ run: uv sync
43
+
44
+ # - name: Run tests
45
+ # if: ${{ steps.release.outputs.release_created }}
46
+ # run: uv run pytest tests/ -v
47
+
48
+ # - name: Run linter
49
+ # if: ${{ steps.release.outputs.release_created }}
50
+ # run: uv run ruff check .
51
+
52
+ - name: Build package
53
+ if: ${{ steps.release.outputs.release_created }}
54
+ run: uv build
55
+
56
+ - name: Publish to PyPI
57
+ if: ${{ steps.release.outputs.release_created }}
58
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,40 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ name: Test Suite (Python ${{ matrix.python-version }})
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ run: uv python install ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --all-extras
27
+
28
+ - name: Run tests
29
+ run: uv run pytest tests/ -v --tb=short
30
+
31
+ - name: Generate coverage report
32
+ if: matrix.python-version == '3.11'
33
+ run: uv run pytest tests/ --cov=src/opendisplay --cov-report=xml --cov-report=term
34
+
35
+ - name: Upload coverage to Codecov
36
+ if: matrix.python-version == '3.11'
37
+ uses: codecov/codecov-action@v4
38
+ with:
39
+ file: ./coverage.xml
40
+ fail_ci_if_error: false
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,20 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "release-type": "python",
5
+ "package-name": "py-opendisplay",
6
+ "bump-minor-pre-major": true,
7
+ "bump-patch-for-minor-pre-major": true,
8
+ "changelog-sections": [
9
+ { "type": "feat", "section": "Features" },
10
+ { "type": "fix", "section": "Bug Fixes" },
11
+ { "type": "perf", "section": "Performance Improvements" },
12
+ { "type": "docs", "section": "Documentation" },
13
+ { "type": "refactor", "section": "Code Refactoring" },
14
+ { "type": "test", "section": "Tests" },
15
+ { "type": "build", "section": "Build System" },
16
+ { "type": "ci", "section": "Continuous Integration" }
17
+ ]
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.0.0"
3
+ }
@@ -0,0 +1,82 @@
1
+ # Changelog
2
+
3
+ ## [1.0.0](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.3.0...v1.0.0) (2026-01-09)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **connection:** Removed get_device_lock from public API. The global per-device lock mechanism has been removed in favor of simpler single-instance usage pattern.
9
+
10
+ ### Features
11
+
12
+ * **connection:** integrate bleak-retry-connector for reliable connections ([088c187](https://github.com/OpenDisplay-org/py-opendisplay/commit/088c187c32e6b6564ef5d12184dbe57976e60cf7))
13
+
14
+ ## [0.3.0](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.2.1...v0.3.0) (2025-12-30)
15
+
16
+
17
+ ### Features
18
+
19
+ * add sha to firmware version parsing ([a47d58e](https://github.com/OpenDisplay-org/py-opendisplay/commit/a47d58e07d20b232b65b56d74edef64477497a37))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * fix compressed image upload with chunking ([5d1b48a](https://github.com/OpenDisplay-org/py-opendisplay/commit/5d1b48a3ce8e7fae27526fa1d7495f81ef0bd65d)), closes [#5](https://github.com/OpenDisplay-org/py-opendisplay/issues/5)
25
+
26
+
27
+ ### Documentation
28
+
29
+ * add git commit SHA documentation ([0e2ef50](https://github.com/OpenDisplay-org/py-opendisplay/commit/0e2ef50b7b813e87aceaa7620e7759325dcce0e7))
30
+
31
+ ## [0.2.1](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.2.0...v0.2.1) (2025-12-30)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * correct advertisement data ([ec152ba](https://github.com/OpenDisplay-org/py-opendisplay/commit/ec152ba53ec7c543957db2b6f618f4485c927b68))
37
+
38
+
39
+ ### Documentation
40
+
41
+ * improve README.md ([e90a612](https://github.com/OpenDisplay-org/py-opendisplay/commit/e90a6128fe20b1bbbfcbaa0b303c72e8ab5359d8))
42
+
43
+ ## [0.2.0](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.1.1...v0.2.0) (2025-12-29)
44
+
45
+
46
+ ### Features
47
+
48
+ * add more dithering algorithms ([1b2fc6a](https://github.com/OpenDisplay-org/py-opendisplay/commit/1b2fc6aeef3ef6c3b81e0c23855d38a61e00a62b))
49
+
50
+ ## [0.1.1](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.1.0...v0.1.1) (2025-12-29)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * add conftest ([673db99](https://github.com/OpenDisplay-org/py-opendisplay/commit/673db99bfa85608a2d5bcdea1a36d37b25e76b51))
56
+
57
+ ## 0.1.0 (2025-12-29)
58
+
59
+
60
+ ### Features
61
+
62
+ * add discovery function ([2760ef9](https://github.com/OpenDisplay-org/py-opendisplay/commit/2760ef913440b8689bdc6c39d09050fc5f757b64))
63
+
64
+ ## 0.1.0 (2025-12-29)
65
+
66
+ ### Features
67
+
68
+ * Initial release of py-opendisplay
69
+ * BLE device discovery with `discover_devices()` function
70
+ * Connect by device name or MAC address
71
+ * Automatic image upload with compression support
72
+ * Device interrogation and capability detection
73
+ * Image resize warnings for automatic resizing
74
+ * Support for multiple color schemes (BW, BWR, BWY, BWRY, BWGBRY, GRAYSCALE_4)
75
+ * Firmware version reading
76
+ * TLV config parsing for OpenDisplay protocol
77
+
78
+ ### Documentation
79
+
80
+ * Quick start guide with examples
81
+ * API documentation
82
+ * Image resizing behavior documentation
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 OpenDisplay.org
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.