Skip to content

Commit d1bfd4f

Browse files
authored
Merge pull request #3 from NitorCreations/bump
Bump pytelnetdevice, add example code
2 parents 779c55e + 44e403a commit d1bfd4f

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

.github/workflows/unittest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Python
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.11"
15+
python-version: "3.13"
1616
- name: Install dependencies
1717
run: |
1818
pip install .

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,47 @@
11
# pylw3
2-
Lightware LW3 protocol library
2+
3+
[![Tests](https://github.com/NitorCreations/pylw3/actions/workflows/unittest.yaml/badge.svg)](https://github.com/NitorCreations/pylw3/actions/workflows/unittest.yaml)
4+
[![Linting](https://github.com/NitorCreations/pylw3/actions/workflows/ruff.yaml/badge.svg)](https://github.com/NitorCreations/pylw3/actions/workflows/ruff.yaml)
5+
6+
Lightware LW3 protocol library for controlling Lightware encoders and decoders.
7+
8+
This library uses our [pytelnetdevice](https://github.com/NitorCreations/pytelnetdevice) library under the hood.
9+
10+
## Usage
11+
12+
This is just a basic example, explore the library to and the documentation for the LW3 protocol for your specific
13+
device to learn more.
14+
15+
```python
16+
import asyncio
17+
18+
from pylw3 import LW3
19+
20+
21+
async def main():
22+
# Connect to a VINX decoder and print the current input
23+
decoder_device = LW3("10.211.0.23", 6107)
24+
async with decoder_device.connection():
25+
video_channel_id = await decoder_device.get_property("/SYS/MB/PHY.VideoChannelId")
26+
print(video_channel_id)
27+
28+
# Connect to a VINX encoder and print whether signal is present
29+
encoder_device = LW3("10.211.0.86", 6107)
30+
async with encoder_device.connection():
31+
signal_present = await encoder_device.get_property("/MEDIA/VIDEO/I1.SignalPresent")
32+
print(signal_present)
33+
34+
35+
asyncio.run(main())
36+
```
37+
38+
This will output something like:
39+
40+
```
41+
9
42+
0
43+
```
44+
45+
## License
46+
47+
GNU GENERAL PUBLIC LICENSE version 3

examples/basic.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import asyncio
2+
3+
from pylw3 import LW3
4+
5+
6+
async def main():
7+
# Connect to a VINX decoder and print the current input
8+
decoder_device = LW3("10.211.0.23", 6107)
9+
async with decoder_device.connection():
10+
video_channel_id = await decoder_device.get_property("/SYS/MB/PHY.VideoChannelId")
11+
print(video_channel_id)
12+
13+
# Connect to a VINX encoder and print whether signal is present
14+
encoder_device = LW3("10.211.0.86", 6107)
15+
async with encoder_device.connection():
16+
signal_present = await encoder_device.get_property("/MEDIA/VIDEO/I1.SignalPresent")
17+
print(signal_present)
18+
19+
20+
asyncio.run(main())

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ classifiers = [
1010
"Operating System :: OS Independent",
1111
"Programming Language :: Python :: 3",
1212
]
13-
requires-python = ">=3.11"
13+
requires-python = ">=3.13"
1414
dependencies = [
15-
"pytelnetdevice @ git+https://github.com/NitorCreations/pytelnetdevice@ab5b48c"
15+
"pytelnetdevice @ git+https://github.com/NitorCreations/pytelnetdevice@0.2.0"
1616
]
1717

1818
[tool.ruff]

0 commit comments

Comments
 (0)