Asyncio PJLink library (Class 1 and Class 2)
Project description
aiopjlink
A modern Python asyncio PJLink library (Class I and Class II).
What is aiopjlink?
Most projectors that have RJ45 ports on the back can be controlled via PJLink.
PJLink is a unified standard for operating and controlling data projectors via TCP/IP
, regardless of manufacturer.
PJLink is a communication protocol used by audiovisual equipment.
- Class 1 is the most common type of PJLink, and is used for basic commands such as power on/off, input selection, and adjusting volume.
- Class 2 is an extended version of the protocol that supports additional commands such as opening and closing the projector's lens cover, and is typically used by more sophisticated devices.
PJLink consists of Class 1 commands and queries, as well as Class 2 notifications and extensions.
Usage
Each "connection" to a projector is managed through a PJLink
context manager. Once this is connected, you access the different functions through a high level API (e.g. conn.power.turn_off()
, conn.lamps.hours()
, conn.errors.query()
, etc).
For example, create a PJLink
connection to the projector and issue commands:
async with PJLink(address="192.168.1.120", password="secretpassword") as link:
# Turn on the projector.
await link.power.turn_on()
# Wait a few seconds, then print out all the error information.
await asyncio.sleep(5)
print("errors = ", await link.errors.query())
# Then wait a few seconds, then turn the projector off.
await asyncio.sleep(5)
await link.power.turn_off()
Development
We use the PDM package manager.
pdm install --dev # install all deps required to run and test the code
pdm run lint # check code quality
pdm run test # check all test cases run OK
pdm publish # Publish the project to PyPI
Other notes:
- There are more "pdm scripts" in the
.toml
file. - Set the env variable
AIOPJLINK_PRINT_DEBUG_COMMS
to print debug comms to the console.
Roadmap
Pull requests with test cases are welcome. There are still some things to finish, including:
- Search Protocol (§3.2)
- Status Notification Prototol (§3.3)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiopjlink-1.0.3.tar.gz
.
File metadata
- Download URL: aiopjlink-1.0.3.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.1.5 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20d4fd2ede907a35d20db4cca4a798bb0879a8572e1aae13913cb9fa09f837e2 |
|
MD5 | 1b457c742ba2b8dd1d7464bffea48dcd |
|
BLAKE2b-256 | a38b68d83370db26f3477afc9a98898079f8eba68755a338d04efe4c6897f80e |
File details
Details for the file aiopjlink-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: aiopjlink-1.0.3-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.1.5 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a51e26c1fa91fd4a2388efc988955ae070f08ac9a3a188081b0a3b8f65d748c |
|
MD5 | 3d3ed92ae6b8f3655f1e98062bd30b63 |
|
BLAKE2b-256 | 0e00b90d2e54df3b7409755d926cf138531f8a9b3741f7fe1f4e541c32764c7a |