-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15b9a1a
commit 0c73297
Showing
23 changed files
with
1,341 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: release | ||
run-name: Creating releases/${{ inputs.version }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
create_release_branch: | ||
name: Create release branch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update version | ||
run: | | ||
echo "${{ github.event.inputs.version }}" > src/linkplay/__version__.py | ||
- name: Create release branch | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git checkout -B releases/${{ github.event.inputs.version }} | ||
git commit --allow-empty -am "Create version ${{ github.event.inputs.version }}" | ||
git push --set-upstream origin releases/${{ github.event.inputs.version }} | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
|
||
pypi-publish: | ||
runs-on: ubuntu-latest | ||
name: Upload release to PyPI | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/python-linkplay | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ['3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
- name: Test with tox | ||
run: tox |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
.vscode |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Velleman Group nv | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
|
||
[![PyPI package](https://badge.fury.io/py/python-linkplay.svg)](https://pypi.org/project/python-linkplay/) | ||
|
||
[![Release](https://github.com/velleman/python-linkplay/actions/workflows/release/badge.svg)](https://github.com/velleman/python-linkplay/actions/workflows/release.yaml) | ||
|
||
# python-linkplay | ||
LinkPlay library for Python | ||
A Python Library for Seamless LinkPlay Device Control | ||
|
||
## Intro | ||
|
||
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-linkpaly, you can harness this capability and seamlessly manage your LinkPlay devices from within your Python applications. | ||
|
||
## Key features | ||
|
||
1. Unified Control: python-linkplay provides a unified interface for controlling various LinkPlay-enabled devices, streamlining the process of interacting with speakers, smart home audio systems, and more. | ||
|
||
2. Device Discovery: Easily discover and connect to LinkPlay devices on your network, ensuring a hassle-free setup and integration into your Python applications. | ||
|
||
3. Playback Management: Take charge of audio playback on LinkPlay devices with functions to play, pause, skip tracks, adjust volume, and more, offering a comprehensive set of controls for a seamless user experience. | ||
|
||
4. Metadata Retrieval: Retrieve essential metadata such as track information, artist details, and album data, enabling you to enhance the user interface and display relevant information in your applications. | ||
|
||
## LinkPlay API documentation | ||
|
||
- https://github.com/n4archive/LinkPlayAPI | ||
- https://github.com/nagyrobi/home-assistant-custom-components-linkplay | ||
- https://github.com/ramikg/linkplay-cli | ||
- https://developer.arylic.com/httpapi/ | ||
- http://airscope-audio.net/core2/pdf/airscope-module-http.pdf | ||
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf | ||
|
||
## Multiroom | ||
|
||
![Alt text](image.png) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[build-system] | ||
requires = ["setuptools>=42.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pytest.ini_options] | ||
asyncio_mode = "auto" | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
log_cli = true | ||
log_cli_level = "INFO" | ||
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)" | ||
log_cli_date_format = "%Y-%m-%d %H:%M:%S" | ||
|
||
[tool.mypy] | ||
mypy_path = "src" | ||
check_untyped_defs = true | ||
disallow_any_generics = true | ||
ignore_missing_imports = true | ||
no_implicit_optional = true | ||
show_error_codes = true | ||
strict_equality = true | ||
warn_redundant_casts = true | ||
warn_return_any = true | ||
warn_unreachable = true | ||
warn_unused_configs = true | ||
no_implicit_reexport = true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# requirements.txt | ||
# | ||
# installs dependencies from ./setup.py, and the package itself, | ||
# in editable mode | ||
-e . | ||
|
||
# (the -e above is optional). you could also just install the package | ||
# normally with just the line below (after uncommenting) | ||
# . |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# requirements_dev.txt | ||
# | ||
# installs dev dependencies from ./setup.py, and the package itself, | ||
# in editable mode | ||
-e ./[testing] | ||
|
||
# (the -e above is optional). you could also just install the package | ||
# normally with just the line below (after uncommenting) | ||
# . |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[metadata] | ||
name = python_linkplay | ||
description = A Python Library for Seamless LinkPlay Device Control | ||
author = Velleman Group nv | ||
version = attr: linkplay.VERSION | ||
license = MIT | ||
classifiers = | ||
Programming Language :: Python :: 3 | ||
|
||
[options] | ||
packages = find_namespace: | ||
install_requires = | ||
async-timeout==4.0.3 | ||
aiohttp==3.9.1 | ||
async_upnp_client==0.38.0 | ||
python_requires = >=3.8 | ||
package_dir = | ||
=src | ||
zip_safe = no | ||
|
||
[options.package_data] | ||
linkplay = py.typed | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.extras_require] | ||
testing = | ||
pytest>=7.3.1 | ||
pytest-cov>=4.1.0 | ||
pytest-mock>=3.10.0 | ||
pytest-asyncio>=0.23.3 | ||
mypy>=1.3.0 | ||
flake8>=6.0.0 | ||
tox>=4.6.0 | ||
typing-extensions>=4.6.3 | ||
|
||
[flake8] | ||
max-line-length = 160 | ||
per-file-ignores = | ||
*/__init__.py: F401 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from setuptools import setup | ||
|
||
|
||
if __name__ == "__main__": | ||
setup() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from linkplay.__version__ import __version__ as VERSION |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import asyncio | ||
import aiohttp | ||
|
||
from linkplay.discovery import discover_linkplay_bridges, discover_multirooms | ||
|
||
|
||
async def main(): | ||
async with aiohttp.ClientSession() as session: | ||
bridges = await discover_linkplay_bridges(session) | ||
multirooms = await discover_multirooms(bridges) | ||
return bridges, multirooms | ||
|
||
if __name__ == "__main__": | ||
asyncio.run(main()) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = '0.0.0' |
Oops, something went wrong.