{ "info": { "author": "Phil Porter", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: AsyncIO", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Home Automation", "Topic :: Terminals :: Serial" ], "description": "# rsp1570serial\n\nAn asyncio based package to talk to a Rotel RSP-1570 processor using the RS-232 protocol\n\nSee [this document](http://www.rotel.com/sites/default/files/product/rs232/RSP1570%20Protocol.pdf) for the protocol definition\n\nKnown 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)\n\nThe 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.\n\nThis library was built to support a rotel_rsp1570 media player platform entity for [Home Assistant](https://www.home-assistant.io/) that can be found [here](https://github.com/pp81381/hassdev).\n\n# Usage\n\nThe RotelAmpConn object encapsulates all of the functionality of the library:\n\n```python\n from rsp1570serial.connection import RotelAmpConn\n\n try:\n conn = RotelAmpConn(serial_port)\n await conn.open()\n except:\n logging.error(\"Could not open connection\", exc_info=True)\n else:\n # Do something here\n conn.close()\n```\n\nThe serial_port parameter can be anything that can be passed to `serial.serial_for_url()`. E.g.\n\n* `/dev/ttyUSB0` (Linux)\n* `COM3` (Windows)\n* `socket://192.168.0.100:50000` (if you are using a TCP/IP to serial converter)\n\nSend a command (see `commands.py` for the full list):\n\n```python\n await conn.send_command('MUTE_TOGGLE')\n```\n\nSend a volume direct command to a zone:\n\n```python\n from rsp1570serial.commands import MIN_VOLUME, MAX_VOLUME\n\n zone = 1\n await conn.send_volume_direct_command(zone, MAX_VOLUME)\n await asyncio.sleep(1)\n await conn.send_volume_direct_command(zone, MIN_VOLUME)\n await asyncio.sleep(1)\n await conn.send_volume_direct_command(zone, 50)\n```\n\nRead the input stream from the device:\n\n```python\n async for message in conn.read_messages():\n if (isinstance(message, (FeedbackMessage, TriggerMessage))):\n message.log()\n else:\n logging.warning(\"Unknown message type encountered\")\n```\n\nPlease see example1.py and example2.py for fully working examples.\n\nThe `conn.read_messages()` will return a message-type specific object containing the message data. Two types of message can be encountered:\n\n* `FeedbackMessage`: Reflects what is shown on the front-panel display. Received when the display changes.\n* `TriggerMessage`: Received whenever the 12V triggers change state.\n\n## FeedbackMessage\n\nThis message reflects what is shown on the display of the device and will be recieved whenever the display changes. This would typically be after an RS-232 or InfraRed command has been received or after a front panel button has been pressed.\n\nThe object has 3 properties:\n\nProperty|Type|Description\n--------|----|-----------\n`msg.lines`|two element list|The two lines of the display\n`msg.flags`|bytes|Flags representing the state of the icons on the display\n`msg.icons`|dict of str:bool|A dictionary keyed on icon code reflecting the on/off state of each icon\n\nMethods of interest are:\n\nMethod|Description\n---|---\n`msg.icons_that_are_on()`|Returns a list of the icon codes of any display icons that are on. Primarily used for testing and debugging.\n`msg.parse_display_lines()`| Parse the display lines and return as much as we can infer about the state of the amp in a dict.\n\nThe following table shows the contents of the dict returned by the `parse_display_lines()` method.\n\nKey|Description\n---|---\n`is_on`| On flag (bool)\n`source_name`| Source Name (max. 8 characters)\n`volume`| Volume (int)\n`mute_on`|Mute On Flag (bool),\n`party_mode_on`| Party Mode Flag (bool)\n`info`| Display Line 2\n\nThe following table shows all of the icon codes.\n\nCode|Name|Category|Friendly Name\n---|---|---|---\n `A`|`rsp1570_input_analog`|`input_icons`| Analog\n `5`|`rsp1570_input_5`|`input_icons`| Input 5\n `4`|`rsp1570_input_4`|`input_icons`| Input 4\n `3`|`rsp1570_input_3`|`input_icons`| Input 3\n `2`|`rsp1570_input_2`|`input_icons`| Input 2\n `1`|`rsp1570_input_1`|`input_icons`| Input 1\n `Coaxial`|`rsp1570_input_coaxial`|`input_icons`| Coaxial\n `Optical`|`rsp1570_input_optical`|`input_icons`| Optical\n `HDMI`|`rsp1570_input_hdmi`|`input_icons`| HDMI\n `Pro Logic`|`rsp1570_sound_mode_pro_logic`|`sound_mode_icons`| Pro Logic\n `II`|`rsp1570_sound_mode_ii`|`sound_mode_icons`| II\n `x`|`rsp1570_sound_mode_x`|`sound_mode_icons`| x\n `Dolby Digital`|`rsp1570_sound_mode_dolby_digital`|`sound_mode_icons`| Dolby Digital\n `EX`|`rsp1570_sound_mode_ex`|`sound_mode_icons`| EX\n `dts`|`rsp1570_sound_mode_dts`|`sound_mode_icons`| dts\n `ES`|`rsp1570_sound_mode_es`|`sound_mode_icons`| ES\n `7.1`|`rsp1570_sound_mode_71`|`sound_mode_icons`|7.1\n `5.1`|`rsp1570_sound_mode_51`|`sound_mode_icons`|5.1\n `Display Mode0`|`rsp1570_state_display_mode0`|`state_icons`| Display Mode 0\n `Display Mode1`|`rsp1570_state_display_mode1`|`state_icons`| Display Mode 1\n `Standby LED`|`rsp1570_state_standby_led`|`state_icons`| Standby LED\n `Zone 2`|`rsp1570_state_zone2`|`state_icons`| Zone 2\n `Zone 3`|`rsp1570_state_zone3`|`state_icons`| Zone 3\n `Zone 4`|`rsp1570_state_zone4`|`state_icons`| Zone 4\n `Zone`|`rsp1570_state_zone`|`state_icons`| Zone\n `FR`|`rsp1570_speaker_front_right`|`speaker_icons`| Front Right\n `C`|`rsp1570_speaker_center`|`speaker_icons`| Center\n `FL`|`rsp1570_speaker_front_left`|`speaker_icons`| Front Left\n `SW`|`rsp1570_speaker_subwoofer`|`speaker_icons`| Subwoofer\n `SR`|`rsp1570_speaker_surround_right`|`speaker_icons`| Surround Right\n `SL`|`rsp1570_speaker_surround_left`|`speaker_icons`| Surround Left\n `CBL`|`rsp1570_speaker_center_back_left`|`speaker_icons`| Center Back Left\n `CBR`|`rsp1570_speaker_center_back_right`|`speaker_icons`| Center Back Right\n `SB`|`rsp1570_speaker_center_back`|`speaker_icons`| Center Back\n `<`|`rsp1570_misc_lt`|`misc_icons`| Misc <\n `>`|`rsp1570_misc_gt`|`misc_icons`| Misc >\n\n## TriggerMessage\n\nThis object has one property called `flags` of type `bytes` that reflects the state of the 12V triggers by zone.\n\nThe method `flags_to_list()` returns a list of the following form:\n\n```python\n[\n ['All', ['on', 'off', 'off', 'off', 'off', 'off']],\n ['Main', ['on', 'off', 'off', 'off', 'off', 'off']],\n ['Zone 2', ['off', 'off', 'off', 'off', 'off', 'off']],\n ['Zone 3', ['off', 'off', 'off', 'off', 'off', 'off']],\n ['Zone 4', ['off', 'off', 'off', 'off', 'off', 'off']],\n]\n```\n\n# Emulator\nThe package also includes an RSP-1570 emulator that can be used for demonstration or testing purposes.\n\nExamples of usage:\n\n```\n# Start the emulator on port 50000\npython3 -m rsp1570serial.emulator\n\n# Start the emulator on port 50002\npython3 -m rsp1570serial.emulator -p 50002\n\n# Start the emulator on port 50002 and provide aliases for some of the sources\npython3 -m rsp1570serial.emulator -p 50002 --alias_video_1 CATV --alias_video_2 NMT --alias_video_3 \"APPLE TV\" --alias_video_4 \"FIRE TV\" --alias_video_5 \"BLU RAY\"\n\n# Start the emulator in the on state\npython3 -m rsp1570serial.emulator --is_on\n```\n\nFull list of options:\n\nOption|Description\n--|--\n`-p ` or `--port `|Port number\n`-o` or `--is_on`|If set then the emulator will be turned on initially\n`--cd ` or `--alias_cd `|Alias for the CD source\n`--tape ` or `--alias_tape `|Alias for the TAPE source\n`--tuner ` or `--alias_tuner `|Alias for the TUNER source\n`--video_1 ` or `--alias_video_1 `|Alias for the VIDEO 1 source\n`--video_2 ` or `--alias_video_2 `|Alias for the VIDEO 2 source\n`--video_3 ` or `--alias_video_3 `|Alias for the VIDEO 3 source\n`--video_4 ` or `--alias_video_4 `|Alias for the VIDEO 4 source\n`--video_5 ` or `--alias_video_5 `|Alias for the VIDEO 5 source\n`--multi ` or `--alias_multi `|Alias for the MULTI source\n\nThe emulator can be used in Home Assistant with the rotel_rsp1570 media player platform. Example configuration:\n\n```yaml\nmedia_player:\n- platform: rotel_rsp1570\n name: \"Rotel RSP-1570 emulator\"\n device: socket://192.168.2.119:50002\n source_aliases:\n VIDEO 1: CATV\n VIDEO 2: NMT\n VIDEO 3: APPLE TV\n VIDEO 4: FIRE TV\n VIDEO 5: BLU RAY\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pp81381/rsp1570serial", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "rsp1570serial-pp81381", "package_url": "https://pypi.org/project/rsp1570serial-pp81381/", "platform": "", "project_url": "https://pypi.org/project/rsp1570serial-pp81381/", "project_urls": { "Homepage": "https://github.com/pp81381/rsp1570serial" }, "release_url": "https://pypi.org/project/rsp1570serial-pp81381/0.1.4/", "requires_dist": [ "pyserial (>=3.4)", "pyserial-asyncio (>=0.4)", "aiounittest (>=1.1.0)" ], "requires_python": "~=3.5", "summary": "Rotel RSP-1570 processor asyncio RS-232 protocol", "version": "0.1.4" }, "last_serial": 5226748, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "a05ac3c95835a5aa83562ee84c29e403", "sha256": "109d661511ee1f42b3513ac9657667ed779603fc284a4c519acdbecee632f9c1" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "a05ac3c95835a5aa83562ee84c29e403", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 14613, "upload_time": "2019-04-07T13:34:43", "url": "https://files.pythonhosted.org/packages/9a/99/aa3a90dfc974eb8007393f895eb9e8668ba7a845d02290bf437adbe6ef54/rsp1570serial_pp81381-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56b8b637d9aacc3163bac71197a7d056", "sha256": "f2a58f2cd0ace4098006f1ebce9edc4e0a177a98a5b6048873a4b26927fbb7a3" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.0.5.tar.gz", "has_sig": false, "md5_digest": "56b8b637d9aacc3163bac71197a7d056", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 15774, "upload_time": "2019-04-07T13:34:44", "url": "https://files.pythonhosted.org/packages/1e/89/0d20a02834dae584a045237a550115784709af7891494e5eec9866b01be9/rsp1570serial-pp81381-0.0.5.tar.gz" } ], "0.0.5.dev11": [ { "comment_text": "", "digests": { "md5": "264441761d103551a69ecfc628592c27", "sha256": "5c332ff2db16854aafd7a67f77079e055a9d273325bfbeccac3ecdddceaa426c" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.0.5.dev11-py3-none-any.whl", "has_sig": false, "md5_digest": "264441761d103551a69ecfc628592c27", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 14684, "upload_time": "2019-04-07T13:21:57", "url": "https://files.pythonhosted.org/packages/81/50/9327feac1479a24b3ef6accdc081e814a8f1b067c81f007d6aa74f42710f/rsp1570serial_pp81381-0.0.5.dev11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2363e849e0aa498624dc63d16cb70f73", "sha256": "eff552d96e546fc06a52ce441ccb156c205d806cbd5c1de14f79007451bbcb14" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.0.5.dev11.tar.gz", "has_sig": false, "md5_digest": "2363e849e0aa498624dc63d16cb70f73", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 15782, "upload_time": "2019-04-07T13:21:59", "url": "https://files.pythonhosted.org/packages/42/6a/712321efa83431f6437c818fe3960948662f4184d57778e73c25c6bae7eb/rsp1570serial-pp81381-0.0.5.dev11.tar.gz" } ], "0.0.6.dev2": [ { "comment_text": "", "digests": { "md5": "8838ddde49dbb33fc7ae77b38099342b", "sha256": "7e5c86d780183a7e139951a8c3a6c0262a26958c7a47ed74fdf84bbc58421ac0" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.0.6.dev2-py3-none-any.whl", "has_sig": false, "md5_digest": "8838ddde49dbb33fc7ae77b38099342b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 14800, "upload_time": "2019-04-09T20:37:06", "url": "https://files.pythonhosted.org/packages/42/4a/6a9808222cf70f8646f8889d417b46ae187f86e782108347e16027aea027/rsp1570serial_pp81381-0.0.6.dev2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6358813c484eb08e5efea98021085b99", "sha256": "b417b141e78f0d4c40a096b40abae5ebdd9a9bbf23e3b277b13954c2e8d62ef0" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.0.6.dev2.tar.gz", "has_sig": false, "md5_digest": "6358813c484eb08e5efea98021085b99", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 15788, "upload_time": "2019-04-09T20:37:07", "url": "https://files.pythonhosted.org/packages/21/b0/96d44e17bf2dd58ed4472421cd27336ecd03c581ace98de4c01f96dec159/rsp1570serial-pp81381-0.0.6.dev2.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "36662da087fd9330c84ad67355f2405d", "sha256": "2b46125e47722f4d6c60ee63ef6318ddb7ae02a67671a01d23b764fa7e1c3b1e" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "36662da087fd9330c84ad67355f2405d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 21272, "upload_time": "2019-04-23T19:57:19", "url": "https://files.pythonhosted.org/packages/4e/95/729111aaa68a8c03d859d8228264810fe52632a860a555a8200ffeb9cde9/rsp1570serial_pp81381-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d557e48a66e0ac9663264aca2aa5faf9", "sha256": "a9c3c9913a445834b40fb99353a3235bb1c1c8ee130fb191b75a9034cb35cacf" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d557e48a66e0ac9663264aca2aa5faf9", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 20782, "upload_time": "2019-04-23T19:57:20", "url": "https://files.pythonhosted.org/packages/a6/ae/c2c0663fcb12c38cdc972cdcb215114702a2e0c60363c70b5c6c11aad368/rsp1570serial-pp81381-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f75a66d7817d52f824e95d035c87c06a", "sha256": "e57c279096084b2619fab9713a1c5d9d93a76aaef145c7d302341d9d7094a03b" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f75a66d7817d52f824e95d035c87c06a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 23150, "upload_time": "2019-04-27T15:46:07", "url": "https://files.pythonhosted.org/packages/44/b1/6529adf4a75f1b90d55b7af5656b7b7f315f6ef0e8ab54c22601bb1cc5d8/rsp1570serial_pp81381-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75581b06a722dffe754806dbc1d704cb", "sha256": "1284736827b73aba0dc362a8de36cdc539dc8deb700bea0c4829fd996457bff6" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.1.2.tar.gz", "has_sig": false, "md5_digest": "75581b06a722dffe754806dbc1d704cb", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 24364, "upload_time": "2019-04-27T15:46:12", "url": "https://files.pythonhosted.org/packages/23/3e/aef03685cbe1194ea09b837de62395c88e9d5451d051b8662f61865bfb1d/rsp1570serial-pp81381-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "364f61b2811088f47871b01e4793f928", "sha256": "326b836c33b0d2aa9222c5c1941044946cdc11dec5e93e09c2af1a4e52eb2173" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "364f61b2811088f47871b01e4793f928", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 23331, "upload_time": "2019-05-04T21:18:25", "url": "https://files.pythonhosted.org/packages/bb/85/a1668be1cc16a703834def02023d0edac000a0efb0d5c8aeda6cf4c1183e/rsp1570serial_pp81381-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dfefef6b7ca3ac5242c01e4d5c27551d", "sha256": "899f7b250e2aacc3af41aff358ac56cf564a4c1810f99a88ecae2a23aed72c56" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.1.3.tar.gz", "has_sig": false, "md5_digest": "dfefef6b7ca3ac5242c01e4d5c27551d", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 24523, "upload_time": "2019-05-04T21:18:27", "url": "https://files.pythonhosted.org/packages/6c/13/1629dd3ed80aae4d3f842a2008ca897fe8979094f0b1da9e091eda395dcf/rsp1570serial-pp81381-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "e23b0f1104196894cabf8f075a37bf75", "sha256": "80f3fd456e3eca6492b73ac2334b167276f4c3daa4001263f5a684d41a1b8fea" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e23b0f1104196894cabf8f075a37bf75", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 23277, "upload_time": "2019-05-04T22:13:54", "url": "https://files.pythonhosted.org/packages/0e/d5/f3861812cd657d43862403320a2464eddcdb33074e8a1e4c028710b39077/rsp1570serial_pp81381-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e6121b0beaea602591bec1c57a28ca2", "sha256": "d95508571f27111aba42d4385c831cc20c8a8c400aca5938e4ea7c1c5451cabb" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0e6121b0beaea602591bec1c57a28ca2", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 24475, "upload_time": "2019-05-04T22:13:55", "url": "https://files.pythonhosted.org/packages/c1/fe/6999ffe4d6db6c09a025da845adc0f0ed4ce43f90145113ba5fb56e96ae6/rsp1570serial-pp81381-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e23b0f1104196894cabf8f075a37bf75", "sha256": "80f3fd456e3eca6492b73ac2334b167276f4c3daa4001263f5a684d41a1b8fea" }, "downloads": -1, "filename": "rsp1570serial_pp81381-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e23b0f1104196894cabf8f075a37bf75", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 23277, "upload_time": "2019-05-04T22:13:54", "url": "https://files.pythonhosted.org/packages/0e/d5/f3861812cd657d43862403320a2464eddcdb33074e8a1e4c028710b39077/rsp1570serial_pp81381-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e6121b0beaea602591bec1c57a28ca2", "sha256": "d95508571f27111aba42d4385c831cc20c8a8c400aca5938e4ea7c1c5451cabb" }, "downloads": -1, "filename": "rsp1570serial-pp81381-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0e6121b0beaea602591bec1c57a28ca2", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 24475, "upload_time": "2019-05-04T22:13:55", "url": "https://files.pythonhosted.org/packages/c1/fe/6999ffe4d6db6c09a025da845adc0f0ed4ce43f90145113ba5fb56e96ae6/rsp1570serial-pp81381-0.1.4.tar.gz" } ] }