Rotel RSP-1570 processor asyncio RS-232 protocol
Project description
rsp1570serial
An asyncio based package to talk to a Rotel RSP-1570 processor using the RS-232 protocol
See this document for the protocol definition
Known to work with a GANA USB to RS-232 DB9 cable on Windows 10 (Python 3.7.0) and on Rapbian Stretch (Python 3.5.3)
The protocol is similar to that used by other older Rotel kit. For example, it looks as though the RSP-1572 used a protocol like this. It has a different device id and supports a few more messages but this package could probably be updated to support it.
Usage
The RotelAmpConn object encapsulates all of the functionality of the library:
try:
conn = RotelAmpConn(serial_port)
await conn.open()
except:
logging.error("Could not open connection", exc_info=True)
else:
# Do something here
conn.close()
The serial_port parameter can be anything that can be passed to serial.serial_for_url()
. E.g.
/dev/ttyUSB0
(Linux)COM3
(Windows)socket://192.168.0.100:50000
(if you are using a TCP/IP to serial converter)
Send a command (see commands.py for the full list):
await conn.send_command('MUTE_TOGGLE')
Send a volume direct command to a zone:
zone = 1
volume = 50
await conn.send_volume_direct_command(zone, volume)
Read the input stream from the device:
async for message in conn.read_messages():
if (isinstance(message, (FeedbackMessage, TriggerMessage))):
message.log()
else:
logging.warning("Unknown message type encountered")
Please see example1.py and example2.py for fully working examples.
This library was built to support a rotel_rsp1570 media player platform entity for Home Assistant that I will also make available shortly.
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
Hashes for rsp1570serial-pp81381-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c3c9913a445834b40fb99353a3235bb1c1c8ee130fb191b75a9034cb35cacf |
|
MD5 | d557e48a66e0ac9663264aca2aa5faf9 |
|
BLAKE2b-256 | a6aec2c0663fcb12c38cdc972cdcb215114702a2e0c60363c70b5c6c11aad368 |
Hashes for rsp1570serial_pp81381-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b46125e47722f4d6c60ee63ef6318ddb7ae02a67671a01d23b764fa7e1c3b1e |
|
MD5 | 36662da087fd9330c84ad67355f2405d |
|
BLAKE2b-256 | 4e95729111aaa68a8c03d859d8228264810fe52632a860a555a8200ffeb9cde9 |