{ "info": { "author": "Marco Lertora", "author_email": "marco.lertora@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# PyRecSwitch\n\nA pure-python interface for controlling **Ankuoo RecSwitch MS6126** without the use of mobile app or the cloud platform. \n\nList of similar devices that should work:\n\n* Ankuoo MS6126\n* Ankuoo REC 4800009\n* Lumitek CSW201 NEO WiFi\n\n## Overview\n\nThis package provides a high-level interface for controlling the device. This interface has been developed \nusing *asyncio*, however, if you prefer to use a different stack you can directly invoke the low-level methods \nto parse and compose the messages needed to communicate with the device.\n\n## How it works\n\nRecSwitch use two different protocols to communicate with the world. The first one is used to talk directly \nwith the app mobile when it is in the same network of the device. Instead, the second one is used to talk with its own \ncloud platform to allow the app to control the device when it is in a foreign network. \n*PyRecSwitch* implements the first communication protocol.\n\nSome note about the protocol:\n\n* The communication transport is UDP and the port is 18530.\n* The device and the host listen and send message each other to that port.\n* The host send a request message to the device, the device receive the request and send back the response to the host.\n* The request and the response could be associated through an index reported in both messages.\n* Some messages are sent from the device to the broadcast address of its subnet always on the same port. For example, \nthe relay status change is notified with a broadcast message.\n* Part of the messages are AES encrypted with a fixed key.\n\n## Installation\n\n```bash\npip install pyrecswitch\n```\n\n## Usage\n\nFirst, instantiate the *RSNetwork*.\n```\nfrom pyrecswitch import RSNetwork\n\nnet = RSNetwork()\n```\n\nGenerate the datagram endpoint and ensure it a future with *asyncio*.\n```\nlistener = net.create_datagram_endpoint()\n\ntransport, protocol = loop.run_until_complete(listener)\n```\n\nRegister any devices in your network using their own mac-address and ip-address.\n```\ndevice = net.register_device('F0:FE:6B:XX:XX:XX', '192.168.X.X')\n```\n\nNow, you can access to the device and communicate with it.\n```\ndevice = net.get_device('F0:FE:6B:XX:XX:XX')\n\n# get device info\nret = await device.query_module_info()\n\n# get relay status\nret = await device.get_gpio_status()\n\n# set relay on\nret = await device.set_gpio_status(True)\n```\n\nThat's it!\n\n### Examples\n\nI wrote two simple client examples to explain how the library can be used. Both the examples query the module \ninformation and toggle the relay status.\n\n* **doc/examples/client.py** high-level client interface\n* **doc/examples/udp_socket_client.py** low-level methods for generating and parsing messages\n\n## Contributing\n\nContributions are welcome. Here some useful features that could be developed:\n\n* Device discover\n* Device WIFI setup\n* Other device commands\n\n## Authors\n\n* [**Marco Lertora**](https://github.com/marcolertora/) - \n\n## Contributors\n\n* [**Gianluigi Tiesi**](https://github.com/sherpya) - \nThe one who can find the needle in the haystack, when the needle is an aes key and the haystack is an apk. \n\n## Disclaimer\n\nThis project is the result of reverse engineering work, it has been developed without any relation with the device \nmanufacturer. No warranty is provided either by the author or by the manufacturer. \n\n## License\n\nThis project is licensed under the GNU Affero General Public License v3.0 License - see the [LICENSE](LICENSE.md) file for details\n\n## Links\n\n* Hi Flying Chipset HF-LPB100: http://www.hi-flying.com/index.php?route=product/product/show&product_id=113\n\n* Lumitek CSW201 Ankuoo RecSwitch: http://www.lumitek.cn/en/productsd.php?gid=0&pid=1093\n\n* Lumitek Firmware: https://github.com/mys812/hf\n\n* https://github.com/home-assistant/home-assistant/issues/831\n\n* https://github.com/Diagonactic/Ankuoo\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/marcolertora/pyrecswitch", "keywords": "", "license": "AGPLv3+", "maintainer": "", "maintainer_email": "", "name": "pyrecswitch", "package_url": "https://pypi.org/project/pyrecswitch/", "platform": "", "project_url": "https://pypi.org/project/pyrecswitch/", "project_urls": { "Homepage": "https://github.com/marcolertora/pyrecswitch" }, "release_url": "https://pypi.org/project/pyrecswitch/1.0.2/", "requires_dist": [ "pycryptodome (>=3.6.6)" ], "requires_python": "", "summary": "A pure-python interface for controlling Ankuoo RecSwitch MS6126", "version": "1.0.2" }, "last_serial": 4313143, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "89c1d6d7c55905d9b5c15760a5c39dd6", "sha256": "a09c1f8227bd1675e7389a8f01879892912211f59c265fd5427c7e640940ee8c" }, "downloads": -1, "filename": "pyrecswitch-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "89c1d6d7c55905d9b5c15760a5c39dd6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11146, "upload_time": "2018-08-24T22:55:18", "url": "https://files.pythonhosted.org/packages/47/31/8e22d74117ea829caab449a15e1c193fecf7d60a67fd2064cf22458e2600/pyrecswitch-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f07a761e86c8b70d5fa37638ace8b28", "sha256": "4d75d32778dfc6debd67c1424f513e75ef90e0652d7f6b821cb71105d3c01ec5" }, "downloads": -1, "filename": "pyrecswitch-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5f07a761e86c8b70d5fa37638ace8b28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7138, "upload_time": "2018-08-24T22:55:19", "url": "https://files.pythonhosted.org/packages/92/dd/936f5b79687c730a6cfffc13ace38d3877df9e57d5b5ba267d1f0b6d35fd/pyrecswitch-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "b727a6607b659a08caedd93524d20d44", "sha256": "ff1e28b20b92e3d7bc0be027740a4fc274899154c22e0606187cb773d57da7e3" }, "downloads": -1, "filename": "pyrecswitch-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b727a6607b659a08caedd93524d20d44", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11174, "upload_time": "2018-09-26T16:02:46", "url": "https://files.pythonhosted.org/packages/2c/b5/c2c408d5d9aae55cb528d6dfc8f9814050412763b6cb958c3204591daedf/pyrecswitch-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "127f237346ec44b00a3757771adb1f41", "sha256": "fb006d98b335ca01b4c91766659f66ff8a2f85a6b885404b6c52e85a61451ea7" }, "downloads": -1, "filename": "pyrecswitch-1.0.2.tar.gz", "has_sig": false, "md5_digest": "127f237346ec44b00a3757771adb1f41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7226, "upload_time": "2018-09-26T16:02:48", "url": "https://files.pythonhosted.org/packages/38/86/951d3733cbab92f6a887c662a36e548a2764b0d62136dc839594bd381941/pyrecswitch-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b727a6607b659a08caedd93524d20d44", "sha256": "ff1e28b20b92e3d7bc0be027740a4fc274899154c22e0606187cb773d57da7e3" }, "downloads": -1, "filename": "pyrecswitch-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b727a6607b659a08caedd93524d20d44", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11174, "upload_time": "2018-09-26T16:02:46", "url": "https://files.pythonhosted.org/packages/2c/b5/c2c408d5d9aae55cb528d6dfc8f9814050412763b6cb958c3204591daedf/pyrecswitch-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "127f237346ec44b00a3757771adb1f41", "sha256": "fb006d98b335ca01b4c91766659f66ff8a2f85a6b885404b6c52e85a61451ea7" }, "downloads": -1, "filename": "pyrecswitch-1.0.2.tar.gz", "has_sig": false, "md5_digest": "127f237346ec44b00a3757771adb1f41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7226, "upload_time": "2018-09-26T16:02:48", "url": "https://files.pythonhosted.org/packages/38/86/951d3733cbab92f6a887c662a36e548a2764b0d62136dc839594bd381941/pyrecswitch-1.0.2.tar.gz" } ] }