py-opendisplay 0.1.1__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.
- py_opendisplay-0.1.1/.github/workflows/lint.yml +25 -0
- py_opendisplay-0.1.1/.github/workflows/release.yml +58 -0
- py_opendisplay-0.1.1/.github/workflows/test.yml +40 -0
- py_opendisplay-0.1.1/.gitignore +207 -0
- py_opendisplay-0.1.1/.release-please-config.json +20 -0
- py_opendisplay-0.1.1/.release-please-manifest.json +3 -0
- py_opendisplay-0.1.1/CHANGELOG.md +35 -0
- py_opendisplay-0.1.1/LICENSE +21 -0
- py_opendisplay-0.1.1/PKG-INFO +88 -0
- py_opendisplay-0.1.1/README.md +53 -0
- py_opendisplay-0.1.1/pyproject.toml +76 -0
- py_opendisplay-0.1.1/src/opendisplay/__init__.py +81 -0
- py_opendisplay-0.1.1/src/opendisplay/device.py +557 -0
- py_opendisplay-0.1.1/src/opendisplay/discovery.py +73 -0
- py_opendisplay-0.1.1/src/opendisplay/encoding/__init__.py +17 -0
- py_opendisplay-0.1.1/src/opendisplay/encoding/bitplanes.py +71 -0
- py_opendisplay-0.1.1/src/opendisplay/encoding/compression.py +53 -0
- py_opendisplay-0.1.1/src/opendisplay/encoding/dithering.py +229 -0
- py_opendisplay-0.1.1/src/opendisplay/encoding/images.py +164 -0
- py_opendisplay-0.1.1/src/opendisplay/exceptions.py +38 -0
- py_opendisplay-0.1.1/src/opendisplay/models/__init__.py +46 -0
- py_opendisplay-0.1.1/src/opendisplay/models/advertisement.py +60 -0
- py_opendisplay-0.1.1/src/opendisplay/models/capabilities.py +17 -0
- py_opendisplay-0.1.1/src/opendisplay/models/config.py +427 -0
- py_opendisplay-0.1.1/src/opendisplay/models/enums.py +159 -0
- py_opendisplay-0.1.1/src/opendisplay/protocol/__init__.py +39 -0
- py_opendisplay-0.1.1/src/opendisplay/protocol/commands.py +138 -0
- py_opendisplay-0.1.1/src/opendisplay/protocol/config_parser.py +437 -0
- py_opendisplay-0.1.1/src/opendisplay/protocol/responses.py +119 -0
- py_opendisplay-0.1.1/src/opendisplay/transport/__init__.py +8 -0
- py_opendisplay-0.1.1/src/opendisplay/transport/connection.py +227 -0
- py_opendisplay-0.1.1/tests/conftest.py +0 -0
- py_opendisplay-0.1.1/uv.lock +964 -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,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.1](https://github.com/OpenDisplay-org/py-opendisplay/compare/v0.1.0...v0.1.1) (2025-12-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add conftest ([673db99](https://github.com/OpenDisplay-org/py-opendisplay/commit/673db99bfa85608a2d5bcdea1a36d37b25e76b51))
|
|
9
|
+
|
|
10
|
+
## 0.1.0 (2025-12-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add discovery function ([2760ef9](https://github.com/OpenDisplay-org/py-opendisplay/commit/2760ef913440b8689bdc6c39d09050fc5f757b64))
|
|
16
|
+
|
|
17
|
+
## 0.1.0 (2025-12-29)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* Initial release of py-opendisplay
|
|
22
|
+
* BLE device discovery with `discover_devices()` function
|
|
23
|
+
* Connect by device name or MAC address
|
|
24
|
+
* Automatic image upload with compression support
|
|
25
|
+
* Device interrogation and capability detection
|
|
26
|
+
* Image resize warnings for automatic resizing
|
|
27
|
+
* Support for multiple color schemes (BW, BWR, BWY, BWRY, BWGBRY, GRAYSCALE_4)
|
|
28
|
+
* Firmware version reading
|
|
29
|
+
* TLV config parsing for OpenDisplay protocol
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
|
|
33
|
+
* Quick start guide with examples
|
|
34
|
+
* API documentation
|
|
35
|
+
* 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.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-opendisplay
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python library for OpenDisplay BLE e-paper displays
|
|
5
|
+
Project-URL: Homepage, https://opendisplay.org
|
|
6
|
+
Project-URL: Repository, https://github.com/OpenDisplay-org/py-opendisplay
|
|
7
|
+
Author-email: g4bri3lDev <admin@g4bri3l.de>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ble,bluetooth,display,e-paper,eink,opendisplay
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: System :: Hardware
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: bleak>=1.0.1
|
|
22
|
+
Requires-Dist: numpy>=1.24.0
|
|
23
|
+
Requires-Dist: pillow>=10.0.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: mypy>=1.19.1; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff>=0.14.10; extra == 'dev'
|
|
27
|
+
Provides-Extra: property
|
|
28
|
+
Requires-Dist: hypothesis>=6.148.8; extra == 'property'
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'test'
|
|
31
|
+
Requires-Dist: pytest-cov>=7.0.0; extra == 'test'
|
|
32
|
+
Requires-Dist: pytest-xdist>=3.8.0; extra == 'test'
|
|
33
|
+
Requires-Dist: pytest>=9.0.2; extra == 'test'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# py-opendisplay
|
|
37
|
+
|
|
38
|
+
Python library for communicating with OpenDisplay BLE e-paper displays.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install py-opendisplay
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
### Option 1: Using MAC Address
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from opendisplay import OpenDisplayDevice
|
|
52
|
+
from PIL import Image
|
|
53
|
+
|
|
54
|
+
async with OpenDisplayDevice(mac_address="AA:BB:CC:DD:EE:FF") as device:
|
|
55
|
+
image = Image.open("photo.jpg")
|
|
56
|
+
await device.upload_image(image)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Option 2: Using Device Name (Auto-Discovery)
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from opendisplay import OpenDisplayDevice, discover_devices
|
|
63
|
+
from PIL import Image
|
|
64
|
+
|
|
65
|
+
# List available devices
|
|
66
|
+
devices = await discover_devices()
|
|
67
|
+
print(devices) # {"OpenDisplay-A123": "AA:BB:CC:DD:EE:FF", ...}
|
|
68
|
+
|
|
69
|
+
# Connect using name
|
|
70
|
+
async with OpenDisplayDevice(device_name="OpenDisplay-A123") as device:
|
|
71
|
+
image = Image.open("photo.jpg")
|
|
72
|
+
await device.upload_image(image)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Image Resizing
|
|
76
|
+
|
|
77
|
+
Images are automatically resized to match the display dimensions. A warning is logged if resizing occurs:
|
|
78
|
+
|
|
79
|
+
`WARNING:opendisplay.device:Resizing image from 1920x1080 to 296x128` (device display size)
|
|
80
|
+
|
|
81
|
+
For best results, resize images to the exact display dimensions before uploading.
|
|
82
|
+
|
|
83
|
+
Development
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uv sync --all-extras
|
|
87
|
+
uv run pytest
|
|
88
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# py-opendisplay
|
|
2
|
+
|
|
3
|
+
Python library for communicating with OpenDisplay BLE e-paper displays.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install py-opendisplay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Option 1: Using MAC Address
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from opendisplay import OpenDisplayDevice
|
|
17
|
+
from PIL import Image
|
|
18
|
+
|
|
19
|
+
async with OpenDisplayDevice(mac_address="AA:BB:CC:DD:EE:FF") as device:
|
|
20
|
+
image = Image.open("photo.jpg")
|
|
21
|
+
await device.upload_image(image)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Option 2: Using Device Name (Auto-Discovery)
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from opendisplay import OpenDisplayDevice, discover_devices
|
|
28
|
+
from PIL import Image
|
|
29
|
+
|
|
30
|
+
# List available devices
|
|
31
|
+
devices = await discover_devices()
|
|
32
|
+
print(devices) # {"OpenDisplay-A123": "AA:BB:CC:DD:EE:FF", ...}
|
|
33
|
+
|
|
34
|
+
# Connect using name
|
|
35
|
+
async with OpenDisplayDevice(device_name="OpenDisplay-A123") as device:
|
|
36
|
+
image = Image.open("photo.jpg")
|
|
37
|
+
await device.upload_image(image)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Image Resizing
|
|
41
|
+
|
|
42
|
+
Images are automatically resized to match the display dimensions. A warning is logged if resizing occurs:
|
|
43
|
+
|
|
44
|
+
`WARNING:opendisplay.device:Resizing image from 1920x1080 to 296x128` (device display size)
|
|
45
|
+
|
|
46
|
+
For best results, resize images to the exact display dimensions before uploading.
|
|
47
|
+
|
|
48
|
+
Development
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv sync --all-extras
|
|
52
|
+
uv run pytest
|
|
53
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "py-opendisplay"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Python library for OpenDisplay BLE e-paper displays"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "g4bri3lDev", email = "admin@g4bri3l.de"}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
keywords = ["opendisplay", "e-paper", "eink", "ble", "bluetooth", "display"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
"Topic :: System :: Hardware",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
dependencies = [
|
|
31
|
+
"bleak>=1.0.1",
|
|
32
|
+
"pillow>=10.0.0",
|
|
33
|
+
"numpy>=1.24.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
test = [
|
|
38
|
+
"pytest>=9.0.2",
|
|
39
|
+
"pytest-asyncio>=1.3.0",
|
|
40
|
+
"pytest-cov>=7.0.0",
|
|
41
|
+
"pytest-xdist>=3.8.0"
|
|
42
|
+
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
property = [
|
|
46
|
+
"hypothesis>=6.148.8"
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
dev = [
|
|
50
|
+
"mypy>=1.19.1",
|
|
51
|
+
"ruff>=0.14.10"
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[project.urls]
|
|
55
|
+
Homepage = "https://opendisplay.org"
|
|
56
|
+
Repository = "https://github.com/OpenDisplay-org/py-opendisplay"
|
|
57
|
+
|
|
58
|
+
[tool.hatch.build.targets.wheel]
|
|
59
|
+
packages = ["src/opendisplay"]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 120
|
|
63
|
+
target-version = "py311"
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["E", "F", "W", "I"]
|
|
67
|
+
|
|
68
|
+
[tool.mypy]
|
|
69
|
+
python_version = "3.11"
|
|
70
|
+
strict = true
|
|
71
|
+
warn_return_any = true
|
|
72
|
+
warn_unused_configs = true
|
|
73
|
+
|
|
74
|
+
[tool.pytest.ini_options]
|
|
75
|
+
asyncio_mode = "auto"
|
|
76
|
+
testpaths = ["tests"]
|