Skip to main content

aiopjlink2

A modern Python asyncio PJLink library (Class I and Class II). This is a fork from HEInventions/aiopjlink and Kwull/aiopjlink.

PyPI PyPI - License PyPI - Python Version

PyPI - Downloads GitHub repo size

Most projectors that have RJ45 ports on the back can be controlled via PJLink.

PJLink is a communication protocol and unified standard for operating and controlling data projectors via TCP/IP, regardless of manufacturer.

PJLink consists of Class 1 commands and queries, as well as Class 2 notifications and extensions.

  • 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.

A Python library that uses asyncio to talk to one or more projectors connected to a network using the PJLink protocol.

The main difference from the HEInventions/aiopjlink implementation is that in aiopjlink-kw, each PJLink command is executed over a new TCP/IP connection, including authentication if required. This approach was taken due to the specific PJLink implementation used by AWOL projectors. The additional changes made by aiopjlink2 is the exclusion of the test folder from the package that is published to PyPI. Additionally the context manager has been removed from PJLink because it brings no benefit anymore now, that each command is executed over a new connection.

It has these advantages:

  • ✅ Clean modern asyncio API
  • ✅ High level API abstraction (eg. lamp.hours)
  • ✅ Pure Python 3 implementation (no dependencies)
  • ✅ Full suite of test cases
  • ❌ Context managers for keeping track of connections and resources
  • ✅ High quality error handling

Usage

Each command sent to a projector is creating a new connection. The projector can be initialized with a PJLink instance. Once this is created, 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 instance of the projector and issue commands:

link = PJLink(address="192.168.1.120", password="secretpassword")

# 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)

Metadata

Release files for aiopjlink2 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiopjlink2 1.1.0
File Size Uploaded Provenance Actions
aiopjlink2-1.1.0.tar.gz 13.1 kB Without provenance Details for aiopjlink2-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiopjlink2 1.1.0
File Interpreter ABI Platform Actions
aiopjlink2-1.1.0-py3-none-any.whl Python 3 none any Details for aiopjlink2-1.1.0-py3-none-any.whl

Total release size: 25.4 kB

Release files / aiopjlink2-1.1.0.tar.gz

Download URL aiopjlink2-1.1.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
21d00510349ecdfa8868c04a1a6d964cad45ae66a08f0755a3b793569d659cd0
BLAKE2b-256 checksum
How to use checksums
7dd3066043d6ef8b95087323fbc565b604966833d6c49470e24ed50ff3f27076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.2 CPython/3.14.2 Linux/6.8.0-1064-azure

Release files / aiopjlink2-1.1.0-py3-none-any.whl

Download URL aiopjlink2-1.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c629e7dc5a57bd29c318e0f4023587a3125ee1a4a14e1802d585cbc44b5437db
BLAKE2b-256 checksum
How to use checksums
8d86fdf3bffe3921adcce3986b62d9d236d66c6c25afc4f4dcaf2b4ef88fa56d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.2 CPython/3.14.2 Linux/6.8.0-1064-azure

Security for aiopjlink2 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page