{ "info": { "author": "Homegear GmbH", "author_email": "contact@homegear.email", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: POSIX", "Programming Language :: C++" ], "description": "python3-homegear\n================\n\npython3-homegear is a python extension to connect to Homegear over Unix Domain Sockets. It supports all of Homegear's RPC methods and live event reception.\n\n## Prerequisites\n\nThe extension requires `libhomegear-ipc` to be installed and it needs at least Python version 3. To install it, add the Homegear APT repository for your distribution (see https://homegear.eu/downloads.html) and execute\n\n```bash\napt install libhomegear-ipc\n```\n\nAlternatively on non Debian-like systems you can compile libhomegear-ipc manually:\n\n```bash\ngit clone https://github.com/Homegear/libhomegear-ipc\ncd libhomegear-ipc\n./makeRelease.sh\n```\n\n## Setup\n\nif you have pip, just do:\n\n```bash\nsudo python3 -m pip install homegear\n```\n\nTo compile and install the extension manually, download it from GibHut and execute\n\n```bash\nsudo python3 setup.py install\n```\n\n## Methods\n\nThere is only one object available: `Homegear`. It takes two parameters in it's constructor: The path to the Homegear IPC socket (normally `/var/run/homegear/homegearIPC.sock`) and a callback method. The callback method is executed when a device variable is updated in Homegear. On instantiation the class waits until it is connected succesfully to Homegear. After 2 seconds it returns even if there is no connection. To check, if the object is still connected, you can call `connected()`. Apart from this method, you can call all RPC methods available in Homegear ([see ref.homegear.eu](https://ref.homegear.eu/rpc.html)).\n\n## Behaviour on no connection\n\nWhen there is no connection to Homegear, the constructor returns after 2 seconds. It indefinitely tries to reconnect until it is able to establish a connection. The same happens on connection loss. To check if the module is connected, call `connected()`. Even when there is no connection, you can still call all RPC methods without exception. The return value will be `None`.\n\n## Type conversion\n\n### Python variable to Homegear variable\n\nPython | Homegear\n-------|---------\nNone | Void\nBool | Boolean\nLong | Integer\nFloat | Float\nUnicode | String\nBytes | Binary\nList | Array\nTuple | Array\nDict | Struct\n\n### Homegear variable to Python variable\n\nHomegear | Python\n-------|---------\nVoid | None\nBoolean | Bool\nInteger | Long\nFloat | Float\nString | Unicode\nBinary | Bytes\nArray | List\nStruct | Dict\n\n## Usage example\n\nA minimal example:\n\n```python\nfrom homegear import Homegear\n\n# This callback method is called on Homegear variable changes\ndef eventHandler(eventSource, peerId, channel, variableName, value):\n\t# Note that the event handler is called by a different thread than the main thread. I. e. thread synchronization is\n\t# needed when you access non local variables.\n\tprint(\"Event handler called with arguments: source: \" + eventSource + \" peerId: \" + str(peerId) + \"; channel: \" + str(channel) + \"; variable name: \" + variableName + \"; value: \" + str(value));\n\nhg = Homegear(\"/var/run/homegear/homegearIPC.sock\", eventHandler);\n```\n\nPlease note that the callback method is called from a different thread. Please use thread synchronization when accessing shared variables.\n\nTo execute a RPC method, just type `hg.`. For example to set the system variable \"TEST\" to \"6\" and retrieve it again:\n\n```python\nhg.setSystemVariable(\"TEST\", 6);\nprint(hg.getSystemVariable(\"TEST\"));\n```\n\nA full example:\n\n```python\nimport time\nfrom homegear import Homegear\n\n# This callback method is called on Homegear variable changes\ndef eventHandler(eventSource, peerId, channel, variableName, value):\n\t# Note that the event handler is called by a different thread than the main thread. I. e. thread synchronization is\n\t# needed when you access non local variables.\n\tprint(\"Event handler called with arguments: source: \" + eventSource + \" peerId: \" + str(peerId) + \"; channel: \" + str(channel) + \"; variable name: \" + variableName + \"; value: \" + str(value));\n\nhg = Homegear(\"/var/run/homegear/homegearIPC.sock\", eventHandler);\n\n# hg waits until the connection is established (but for a maximum of 2 seonds).\n\nhg.setSystemVariable(\"TEST\", 6);\nprint(\"getSystemVariable(\\\"TEST\\\") after setting \\\"TEST\\\" to 6: \", hg.getSystemVariable(\"TEST\"));\n\nhg.setSystemVariable(\"TEST\", [\"One\", 2, 3.3]);\nprint(\"getSystemVariable(\\\"TEST\\\") after setting \\\"TEST\\\" to an array: \", hg.getSystemVariable(\"TEST\"));\n\nhg.setSystemVariable(\"TEST\", {\"One\": 1, 2: \"Two\", 3: [3, 3, 3]});\nprint(\"getSystemVariable(\\\"TEST\\\") after setting \\\"TEST\\\" to a struct: \", hg.getSystemVariable(\"TEST\"));\n\ncounter = 0;\nwhile(hg.connected()):\n\ttime.sleep(1);\n\tcounter += 1;\n\thg.setSystemVariable(\"TEST\", counter);\n```\n\n## Links\n\n* [GitHub Project](https://github.com/Homegear/python3-homegear)\n* [Homegear Website](https://homegear.eu)\n* [Homegear Reference](https://ref.homegear.eu)\n* [Homegear Documentation](https://doc.homegear.eu)", "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/Homegear/python3-homegear", "keywords": "homegear,smart home", "license": "", "maintainer": "", "maintainer_email": "", "name": "homegear", "package_url": "https://pypi.org/project/homegear/", "platform": "", "project_url": "https://pypi.org/project/homegear/", "project_urls": { "Homepage": "https://github.com/Homegear/python3-homegear" }, "release_url": "https://pypi.org/project/homegear/1.0.14/", "requires_dist": null, "requires_python": "", "summary": "Extension to connect to a local Homegear service.", "version": "1.0.14" }, "last_serial": 5377225, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "e470343e3e374f15e8aec774c4794c2b", "sha256": "b0550e2bd372d751d5d1e00323610d79ab4c7c6431b5316b659886746e120875" }, "downloads": -1, "filename": "homegear-1.0.10.tar.gz", "has_sig": false, "md5_digest": "e470343e3e374f15e8aec774c4794c2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8238, "upload_time": "2018-07-02T16:59:38", "url": "https://files.pythonhosted.org/packages/52/44/5b6166aada7323c988b233e6ef6f25a35dc6688c03d8c174ae76e6ff5cb5/homegear-1.0.10.tar.gz" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "69e262cb1e4b125e9efe84bf0aff064a", "sha256": "9c8ae304b0416471a558031b6fc2c9cc089c39d0c9ff7dbfbd0e1058362f6586" }, "downloads": -1, "filename": "homegear-1.0.11.tar.gz", "has_sig": false, "md5_digest": "69e262cb1e4b125e9efe84bf0aff064a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8745, "upload_time": "2018-08-16T20:56:57", "url": "https://files.pythonhosted.org/packages/3a/ef/0e2d017f4dc848ea916523ca1b4d2b26d2d6bfde170be70461b71ac93d83/homegear-1.0.11.tar.gz" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "c0d2cb5d0adf2afcdbe3e181dc5c7693", "sha256": "bfd42826c9e513ec3ed8fa932d3b6a3635cfed25c8a0a333358c8597b7851790" }, "downloads": -1, "filename": "homegear-1.0.12.tar.gz", "has_sig": false, "md5_digest": "c0d2cb5d0adf2afcdbe3e181dc5c7693", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8386, "upload_time": "2019-01-02T07:47:54", "url": "https://files.pythonhosted.org/packages/48/48/05220c25492c585cb273f45e90e36073c09ea6b2e6132abf21904fbc3afc/homegear-1.0.12.tar.gz" } ], "1.0.13": [ { "comment_text": "", "digests": { "md5": "06d901830dbe136bc393156e422df4d5", "sha256": "19c983512b0a057ae44905b4ff3590a418be54847509d1dc547c505b2ee59010" }, "downloads": -1, "filename": "homegear-1.0.13.tar.gz", "has_sig": false, "md5_digest": "06d901830dbe136bc393156e422df4d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8414, "upload_time": "2019-01-11T12:59:29", "url": "https://files.pythonhosted.org/packages/81/4b/95ee9bc90a945e5492ab33e5759e4e0e43522a78495482f3050ba1c3c722/homegear-1.0.13.tar.gz" } ], "1.0.14": [ { "comment_text": "", "digests": { "md5": "56e9d43a2f77209298e22d82546496ca", "sha256": "54b6b34e41e57d045ac525451111e293ae03105dbd88c0035a96baeeb397bde7" }, "downloads": -1, "filename": "homegear-1.0.14.tar.gz", "has_sig": false, "md5_digest": "56e9d43a2f77209298e22d82546496ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9558, "upload_time": "2019-06-09T09:09:49", "url": "https://files.pythonhosted.org/packages/0c/86/79b3e682e859ed2492998b3a865873924ba1798dc9ce5eb2f5daf5973107/homegear-1.0.14.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d35ef5a2abb9c85ada5502e9d19e197c", "sha256": "b470fdf8ff36b81500993042dbc723b375e1f69b37870d25801b5dfa86039283" }, "downloads": -1, "filename": "homegear-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d35ef5a2abb9c85ada5502e9d19e197c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6343, "upload_time": "2018-05-29T16:42:01", "url": "https://files.pythonhosted.org/packages/8d/1c/4ad411cae3b00a163f1c54624960e341104f10acd6910957a5c988e9017d/homegear-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "30027f4c7b6ff25ff58c2a873f81987c", "sha256": "22c6030cb4b8a5cbe0b2d116ecbcdb357b9ac139e72ec4e76b40ffacec485386" }, "downloads": -1, "filename": "homegear-1.0.3.tar.gz", "has_sig": false, "md5_digest": "30027f4c7b6ff25ff58c2a873f81987c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6751, "upload_time": "2018-05-29T18:50:08", "url": "https://files.pythonhosted.org/packages/7a/34/618b88d6cc0239134d294b22d995b15ae85ac17a908ce70f19b06aaa39c0/homegear-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "7180fbe9133707d9ebeedb851174be5c", "sha256": "78a67a910776fa1ed2ea8843ad1c05c9acf3d91f365bfffd9ebbfad491e6c2f8" }, "downloads": -1, "filename": "homegear-1.0.4.tar.gz", "has_sig": false, "md5_digest": "7180fbe9133707d9ebeedb851174be5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7262, "upload_time": "2018-05-29T20:16:05", "url": "https://files.pythonhosted.org/packages/08/1f/ce6633f0b7bb8964fdf4934758fe7cd579cfa25d015a8c0080e9d33545c3/homegear-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "dcd90805a9f5c67c297382805542c3f9", "sha256": "5894b90dda0642ba2d1e47f501baf345dde67b617a36dafea53b4d53f0ec0ffb" }, "downloads": -1, "filename": "homegear-1.0.5.tar.gz", "has_sig": false, "md5_digest": "dcd90805a9f5c67c297382805542c3f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7705, "upload_time": "2018-05-30T14:02:07", "url": "https://files.pythonhosted.org/packages/7b/b0/3b5d66823d7c92805a5402013c6a4be30753cdda89e525f5196beb072862/homegear-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "cc65917a1999b551c992efe9b19cf621", "sha256": "63f15d99f0c8e429c08056d8964069bc09f31fde305a9b9e6c6c4041c282b9a1" }, "downloads": -1, "filename": "homegear-1.0.6.tar.gz", "has_sig": false, "md5_digest": "cc65917a1999b551c992efe9b19cf621", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7824, "upload_time": "2018-05-30T15:30:29", "url": "https://files.pythonhosted.org/packages/87/de/c6c138041f7414402b2dafc785c003cdece60be3cf0fd2df8718a15f62b7/homegear-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "35e230864e8e33c68480fa549433c898", "sha256": "ee75344691cb5383d121ff0a018e767605ad9c50ee3d2fa881c392d382ed83fe" }, "downloads": -1, "filename": "homegear-1.0.7.tar.gz", "has_sig": false, "md5_digest": "35e230864e8e33c68480fa549433c898", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8118, "upload_time": "2018-05-31T11:18:30", "url": "https://files.pythonhosted.org/packages/6b/66/b8dde37d5711428942530ebb2ba0b31f20e43263d97b9068ac84b0e3fa01/homegear-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "f879ff56d678ad55acd80366f4c9f6e0", "sha256": "82c488f9d2f8bd55001d58d19dde931d096aac75cf1d6d4b1c3bfa473f67e8bc" }, "downloads": -1, "filename": "homegear-1.0.8.tar.gz", "has_sig": false, "md5_digest": "f879ff56d678ad55acd80366f4c9f6e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8172, "upload_time": "2018-05-31T12:05:41", "url": "https://files.pythonhosted.org/packages/52/9d/b56f7a83bc4352318544aade7da6b71fc136d12919622c5ebd0ffe715138/homegear-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "9ee3c6992cd52cfae18305b17f9496d7", "sha256": "b2099e9e29b2330c1a89362736f3238fc06660bf643bc74599c70494b9fa966c" }, "downloads": -1, "filename": "homegear-1.0.9.tar.gz", "has_sig": false, "md5_digest": "9ee3c6992cd52cfae18305b17f9496d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8354, "upload_time": "2018-06-01T10:04:48", "url": "https://files.pythonhosted.org/packages/b5/98/4ff325a91b9a35c476937df83428c2d83ee2d71811d2f914bd3902863e59/homegear-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56e9d43a2f77209298e22d82546496ca", "sha256": "54b6b34e41e57d045ac525451111e293ae03105dbd88c0035a96baeeb397bde7" }, "downloads": -1, "filename": "homegear-1.0.14.tar.gz", "has_sig": false, "md5_digest": "56e9d43a2f77209298e22d82546496ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9558, "upload_time": "2019-06-09T09:09:49", "url": "https://files.pythonhosted.org/packages/0c/86/79b3e682e859ed2492998b3a865873924ba1798dc9ce5eb2f5daf5973107/homegear-1.0.14.tar.gz" } ] }