pyBROTlib
Python interface to BROT telescopes, talking to the telescope's TwinCAT/PLC control system over MQTT.
Installation
uv add pybrotlib
Usage
Connect a transport (currently MQTT) to a named telescope and drive it through the BROT
object:
import asyncio
from pybrotlib import BROT
from pybrotlib.transport import MQTTTransport
async def main() -> None:
transport = MQTTTransport(host="localhost", port=1883)
brot = BROT(transport, "MyTelescope")
# the transport needs its own task to receive telemetry/publish commands
asyncio.create_task(transport.run())
await asyncio.sleep(2) # give it a moment to connect and receive first telemetry
await brot.telescope.track(ra=10.5, dec=41.2)
print(brot.telescope.status)
asyncio.run(main())
transport.telemetry holds the live telemetry tree (see pybrotlib/telemetry.py), which is
kept up to date by messages received on <telescope>/.../Telemetry topics and read by the
component properties below.
Components
Each BROT instance exposes one component per subsystem, all constructed from the same
transport and telescope name:
telescope(BROTTelescope) — pointing (track,move), offsets (set_offset_ha,set_offset_dec,set_offset_alt,set_offset_az), power/park/stop/reset, and status (status,motion_state,global_status).focus(BROTFocus) —position,set(focus),powered,referenced.dome(BROTDome) — shutter/tracking state,open,close,start_tracking,stop_tracking,park,reset.roof(BROTRoof) — roll-off roof state,open,close,stop,reset.mirrorcovers(BROTMirrorCovers) —status,open,close.
All commands are fire-and-forget MQTT publishes; callers are expected to poll telemetry (directly, or via the component's status properties) to observe the result.
Development
uv sync --group dev
uv run pytest
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybrotlib-1.2.0.tar.gz.
File metadata
- Download URL: pybrotlib-1.2.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f22ca4288c29704d6e74f00aa691aa16f96dc3e5c6b2460e4e2b60d81e942b88
|
|
| MD5 |
9ee97698a414d8e41c76696a349c3473
|
|
| BLAKE2b-256 |
80aa1756caeb6e4f2b1ea5c2d34a8f90942d5af6759db4709acadb172835b463
|
File details
Details for the file pybrotlib-1.2.0-py3-none-any.whl.
File metadata
- Download URL: pybrotlib-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ccbe25a8e2fcb70364f8e26ac9af8cd75cc819051232d093b0d0932afb57958
|
|
| MD5 |
2d937e1bdb20e84cf3bca85401fe2080
|
|
| BLAKE2b-256 |
d55200e6c561ceb25f8025bfb741ff25f7080d61a9098850c4d423e518d4380d
|