{ "info": { "author": "Glenn Waters", "author_email": "gwwaters+elkm1@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Python ElkM1 library\n\nLibrary for interacting with ElkM1 alarm/automation panel.\n\nhttps://github.com/gwww/elkm1\n\n## Requirements\n\n- Python 3.5 (or higher)\n\n## Description\n\nThis package is created as a library to interact with an ElkM1 alarm/automation\npattern. The motivation to write this was to use with the Home Assistant\nautomation platform. The library can be used for writing other ElkM1 integration\napplications. The IO with the panel is asynchronous over TCP or over the\nserial port.\n\n## Installation\n\n```bash\n $ pip install elkm1_lib\n```\n\n## Overview\n\nBasic connection to the Elk panel:\n\n```python\n from elkm1_lib import Elk\n import logging\n\n # Print to STDOUT\n LOG = logging.getLogger(__name__)\n logging.basicConfig(level=logging.DEBUG, format='%(message)s')\n \n # Connect to elk\n elk = Elk({'url': 'elk://192.168.1.100'})\n elk.connect()\n elk.run()\n```\n\nThe above will connect to the Elk panel at IP address 192.168.1.100. the `elk://`\nprefix specifies that the connect is plaintext. Alternatively, `elks://` will \nconnect over TLS. In this case a userid and password must be specified\nand the call to `Elk` changes to:\n\n```python\n elk = Elk(\n {'url': 'elks://192.168.1.100', 'userid': 'test', 'password': 'pass'}\n )\n```\n\nTo see working example code take a look at the script `bin/simple`.\n\nThe `Elk` object supports the concept of `Elements`. An `Element`\nis the base class representation of `Zones`, `Lights`, etc. So, for\nexample there is a list of zones: `elk.zones` and each zone can be\naccessed by `elk.zones[index]`. Each element has a `__str__`\nrepresentation so that it is easy to print its contents.\n\nAll `Elements` are referenced starting at 0. Even though the Elk panel\nrefers to, for example, zones 1-208, the library references them\nas zones 0-207. All translation from base 0 to 1 and vice-versa is\nhandled internally in the `elkm1_lib.message` module.\n\nAfter creating the `Elk` object and connecting to the panel the \nlibrary code will synchronize all the elements to the data from the Elk panel.\n\nMany Elk messages are handled by the library, caching their contents. When a\nmessage causes a change to an attribute of an `Element`, registered\ncallbacks are called so that user use of the library can be notified\nof changing elements. The following user code shows registering a callback:\n\n```python\n def call_me(element, changeset):\n print(changeset)\n\n for zone_number in range(Max.ZONES.value):\n elk.zones[zone_number].add_callback(call_me)\n```\n\nThe library encodes, decodes, and processes messages to/from the\nElk panel. All the encoding and decoding is done in `elkm1_lib.message` module.\n\nMessages received are handled with callbacks. The library \ninternally registers callbacks so that decoded messages \ncan be used to update an `Element`. The user of the\nlibrary may also register callbacks. Any particular message\nmay have multiple callbacks.\n\nWhen the message is received it is decoded \nand some validation is done. The message handler is called\nwith the fields of from the decoded message. Each type of\nmessage has parameters that match the message type. All handler parameters\nare named parameters.\n\nHere is an example of a message handler being registered and how it is called:\n\n```python\n def zone_status_change_handler(zone_number, zone_status):\n print(zone_number, zone_status)\n\n elk.add_handler('ZC', zone_status_change_handler)\n```\n\nThe above code registers a callback for 'ZC' (Elk zone status change)\nmessages. When a ZC message is received the handler functions are called\nwith the zone_number and zone_status.\n\n## Utilities\n\nThe `bin` directory of the library has one utility program and\na couple of example uses of the library.\n\n### `mkdoc`\n\nThe utility `mkdoc` creates a Markdown table of the list of Elk\nmessages with a check mark for those messages have encoders/decoders\nand an X for those messages are not planned to be implemented.\nThere are no parameters to `mkdoc`. It outputs to stdout.\nThe data for the report comes from the ElkM1 library code mostly.\nA couple of things are hard coded in the mkdoc script, notably\nthe \"no plans to implement\" list.\n\n### `simple`\n\nThe `simple` Python script is a trivial use of the ElkM1 library.\nIt connects to the panel, syncs to internal memory, and continues\nlistening for any messages from the panel. The URL of the ElkM1 to\nconnect to is retrieved from an environment variable named `ELKM1_URL`.\n\n### `elk`\n\nThe `elk` Python script is a bit of a command interpretor. It can run in\ntwo modes. Non-interactive mode is the default. Just run the `elk` command.\nThe non-interactive mode is similar to `simple` except there are a\ncouple of message handlers (`timeout` and `unknown` handlers).\n\nThe `elk` can also be run in interactive mode by invoking it by\n`elk -i`. In this mode is uses curses (full screen use of the terminal)\nthat has a command line and an output window. `TAB` switches between\nthe command line and output windows. In the output window the arrow keys\nand scrollwheel scroll the contents of the window.\n\nIn the command line when running `elk -i` there are a\nnumber of commands. Start with `help`. Then `help ` for \ndetails on each command. In general there are commands to dump the internal\nstate of elements and to invoke any of the encoders to send a message \nto the Elk panel.\n\nFor example, `light <4, 8, 12-14` would invoke the `__str__` method\nfor the light element to print the cached info for lights 0-3, 8, and 12-14.\n\nAnother example would be `pf 3` which issues the pf (Turn light off)\ncommand for light number 3 (light 4 on the panel -- remember 0\nversus 1 base).\n\nAll of the commands that send messages to the panel are automatically\ndiscovered and are all the XX_encode functions in the ``elkm1_lib.message``\nmodule. The docstring and the XX_encode's parameters are shown as part\nof the help.\n\n## Development\n\nThis project uses [poetry](https://poetry.eustace.io/) for development dependencies. Installation instructions are on their website.\n\nTo get started developing:\n\n```\ngit clone https://github.com/gwww/elkm1.git\ncd elkm1\npoetry install\npoetry shell # Or activate the created virtual environment\nmake test # to ensure everything installed properly\n```\n\nThere is a `Makefile` in the root directory as well. The `make` command\nfollowed by one of the targets in the `Makefile` can be used. If you don't\nhave or wish to use `make` the `Makefile` serves as examples of common\ncommands that can be run.\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/gwww/elkm1", "keywords": "", "license": "MIT", "maintainer": "Glenn Waters", "maintainer_email": "gwwaters+elkm1@gmail.com", "name": "elkm1-lib", "package_url": "https://pypi.org/project/elkm1-lib/", "platform": "", "project_url": "https://pypi.org/project/elkm1-lib/", "project_urls": { "Homepage": "https://github.com/gwww/elkm1" }, "release_url": "https://pypi.org/project/elkm1-lib/0.7.15/", "requires_dist": [ "pytz (>=2018.9,<2019.0)", "pyserial-asyncio (>=0.4.0,<0.5.0)" ], "requires_python": ">=3.5,<4.0", "summary": "Library to interacting with ElkM1 alarm/automation panel.", "version": "0.7.15" }, "last_serial": 5009832, "releases": { "0.6.0": [ { "comment_text": "", "digests": { "md5": "c8f8242c6ba760fd76c2139ae63d2afb", "sha256": "f0c27cc5cec864c918354e356349e93a159172946cfc58620709c9e4fda78ba9" }, "downloads": -1, "filename": "elkm1_lib-0.6.0.tar.gz", "has_sig": false, "md5_digest": "c8f8242c6ba760fd76c2139ae63d2afb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28550, "upload_time": "2018-08-22T22:08:04", "url": "https://files.pythonhosted.org/packages/f0/b8/07b76a4fc5734d389ec147c1c1134b9cf8f581a2dc99c35fafefaecbe15a/elkm1_lib-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "b81640445101292059752212639376b6", "sha256": "e66f134d9ef1195f58115a9fad4414eb35dde9646794eb7d901981c58c2cd6c5" }, "downloads": -1, "filename": "elkm1_lib-0.6.1.tar.gz", "has_sig": false, "md5_digest": "b81640445101292059752212639376b6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28561, "upload_time": "2018-08-23T20:08:34", "url": "https://files.pythonhosted.org/packages/fe/0e/66a8dc214f9986971da362197dd58a08f02497f3162e17a43e6e2ca276a7/elkm1_lib-0.6.1.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "df65788997a18c880156fabc378f0810", "sha256": "41dc108cf7a31ac249970e88fe0b63b957a53d643a4962490db1cfb60a523ee2" }, "downloads": -1, "filename": "elkm1_lib-0.7.0.tar.gz", "has_sig": false, "md5_digest": "df65788997a18c880156fabc378f0810", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28639, "upload_time": "2018-08-26T20:28:26", "url": "https://files.pythonhosted.org/packages/6e/03/e867751bd3c32ce5ddb442cb810784e46ff133107edd337c33e951185ccb/elkm1_lib-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "dfce727bf30698f0c5b0bcc3a510625f", "sha256": "066a02e0d4d152a3b7aaea9bf9484c7c254e8498ea260f7054325ff47096e38d" }, "downloads": -1, "filename": "elkm1_lib-0.7.1.tar.gz", "has_sig": false, "md5_digest": "dfce727bf30698f0c5b0bcc3a510625f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28641, "upload_time": "2018-08-27T04:32:24", "url": "https://files.pythonhosted.org/packages/ff/63/1f7504b14309f7c7a35c8e4ea2966fb6a4fd4dd7287855e4b7d4bc920d46/elkm1_lib-0.7.1.tar.gz" } ], "0.7.10": [ { "comment_text": "", "digests": { "md5": "cf5842f18fe9ef1b24464e3ee5fb8488", "sha256": "19254bcf9814dc65cb482337fb4d9e7bb4ec820decdac0d16938559d29b9cead" }, "downloads": -1, "filename": "elkm1_lib-0.7.10.tar.gz", "has_sig": false, "md5_digest": "cf5842f18fe9ef1b24464e3ee5fb8488", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29559, "upload_time": "2018-09-19T02:08:23", "url": "https://files.pythonhosted.org/packages/42/f1/55a6eb1ba9138a39fbd059b0ba0fb241551b3fa8bb7189076567298ec10b/elkm1_lib-0.7.10.tar.gz" } ], "0.7.11": [ { "comment_text": "", "digests": { "md5": "63db3ca8d106488ede5c7611b7ccd8bb", "sha256": "b44bf524589b454349f1ea65b8a96534daf22895f8a4986b5fba15274f61019c" }, "downloads": -1, "filename": "elkm1_lib-0.7.11.tar.gz", "has_sig": false, "md5_digest": "63db3ca8d106488ede5c7611b7ccd8bb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29802, "upload_time": "2018-11-12T03:51:17", "url": "https://files.pythonhosted.org/packages/34/b1/5d26f52197842cff6dfd04b9d7dace91d70486ad92ad801e90de6bc8377a/elkm1_lib-0.7.11.tar.gz" } ], "0.7.12": [ { "comment_text": "", "digests": { "md5": "77cbf3121a430e7aa5c8472a6401463d", "sha256": "72e74418beeba107b33b2b245af6065fb41fc655994f880d0dedff87aebeab4a" }, "downloads": -1, "filename": "elkm1_lib-0.7.12.tar.gz", "has_sig": false, "md5_digest": "77cbf3121a430e7aa5c8472a6401463d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 30464, "upload_time": "2018-11-14T00:51:20", "url": "https://files.pythonhosted.org/packages/ad/8b/f96b604315f200236757bb5c1639bea885aafa0db9f13fe288849c3235ea/elkm1_lib-0.7.12.tar.gz" } ], "0.7.13": [ { "comment_text": "", "digests": { "md5": "92d74f1df75e3fd3d138deebdb80895b", "sha256": "6d2b855557bdb0804f1ccfee33f9ab7d97f575c67e65f42fa4c3f3b8b0e8984b" }, "downloads": -1, "filename": "elkm1_lib-0.7.13.tar.gz", "has_sig": false, "md5_digest": "92d74f1df75e3fd3d138deebdb80895b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 30553, "upload_time": "2018-12-05T01:26:40", "url": "https://files.pythonhosted.org/packages/c7/06/24549dc36790fd4564be82c30cbbee2012cbb8f86f0d1cf1887198103716/elkm1_lib-0.7.13.tar.gz" } ], "0.7.14": [ { "comment_text": "", "digests": { "md5": "39e256643cc83ffdc68efb166da7fe87", "sha256": "9609324c07fad7dcd55b7f8efad25afad179b037f02801a746e8d1fa8c55d5c8" }, "downloads": -1, "filename": "elkm1_lib-0.7.14.tar.gz", "has_sig": false, "md5_digest": "39e256643cc83ffdc68efb166da7fe87", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 30379, "upload_time": "2019-03-30T19:05:42", "url": "https://files.pythonhosted.org/packages/25/6f/09726516feb1d3299f7a797680ea92d65b49c2bf5934d2542e2b958ffdcd/elkm1_lib-0.7.14.tar.gz" } ], "0.7.15": [ { "comment_text": "", "digests": { "md5": "f47f1b3db2446b15d5eac37e64e9ad3a", "sha256": "c3a8bea298df6afe72a22a65cf81acddf848d4a681794d1006d72747ac69537e" }, "downloads": -1, "filename": "elkm1_lib-0.7.15-py3-none-any.whl", "has_sig": false, "md5_digest": "f47f1b3db2446b15d5eac37e64e9ad3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 92109, "upload_time": "2019-03-31T16:16:47", "url": "https://files.pythonhosted.org/packages/92/f9/3788fab22b32034c5a63dfd3f1595af7c76de1eb42473b48d573390ae7dc/elkm1_lib-0.7.15-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df1353eba8add547246888dff4f9ca9e", "sha256": "22132b3b979c027959771bc883e3287aed45171edc7f9311a74d1ab419f28432" }, "downloads": -1, "filename": "elkm1-lib-0.7.15.tar.gz", "has_sig": false, "md5_digest": "df1353eba8add547246888dff4f9ca9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 30170, "upload_time": "2019-03-31T16:16:45", "url": "https://files.pythonhosted.org/packages/aa/f9/4b5f1ff4d0fd4f0164004f8eea4baafbc7d8f624eaa3ae9538539a4bf141/elkm1-lib-0.7.15.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "bd29aa04762d0a39e79d26af930f28bb", "sha256": "f4b962448b54e18617aca07b9d164eead3064821d7d0e34613355dedea951a3f" }, "downloads": -1, "filename": "elkm1_lib-0.7.2.tar.gz", "has_sig": false, "md5_digest": "bd29aa04762d0a39e79d26af930f28bb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28639, "upload_time": "2018-08-27T18:41:22", "url": "https://files.pythonhosted.org/packages/f6/7a/44ae9224e37c8b31cbecc7e534d9b2242ae3ac223fa484819e447112bd49/elkm1_lib-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "b6cda58ef525e0126870fd8ee8f47dc1", "sha256": "48f8a8c4345c597ed3701cf174eef95e5a3f1382698d410693beb9a16c1a345b" }, "downloads": -1, "filename": "elkm1_lib-0.7.3.tar.gz", "has_sig": false, "md5_digest": "b6cda58ef525e0126870fd8ee8f47dc1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28680, "upload_time": "2018-08-27T22:36:52", "url": "https://files.pythonhosted.org/packages/eb/bf/58f28c43f21d61f13cb41a9d28a0468a656d5fb0453ee56a966d65b7e12c/elkm1_lib-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "bb95880ad4f34b90eeb861cb0116e0de", "sha256": "f15e6b70ca6b7c9253bba73934311b3087496ee3f32fdef6f45e0892d3410aac" }, "downloads": -1, "filename": "elkm1_lib-0.7.4.tar.gz", "has_sig": false, "md5_digest": "bb95880ad4f34b90eeb861cb0116e0de", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28808, "upload_time": "2018-08-28T01:53:16", "url": "https://files.pythonhosted.org/packages/e4/2a/3514e41d5891de92de83e517f9ab23efd87005e8b91f2f5b33e471c81b14/elkm1_lib-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "5a25492e5e10b0ae00c0ff5abd98de2b", "sha256": "9eab02325fb7bf4da3495729fa016abd00309d053e485bcf34a6719e74b35484" }, "downloads": -1, "filename": "elkm1_lib-0.7.5.tar.gz", "has_sig": false, "md5_digest": "5a25492e5e10b0ae00c0ff5abd98de2b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 28944, "upload_time": "2018-08-29T02:39:02", "url": "https://files.pythonhosted.org/packages/38/49/d5d4a678722edc1b0b6bf0319eeb7aeb44ab0aca4be1a1978e86194d0052/elkm1_lib-0.7.5.tar.gz" } ], "0.7.6": [ { "comment_text": "", "digests": { "md5": "eec93b034d484c36d98fa4ae6cca86a0", "sha256": "951402ce561e3d649eea856f8d147a5cb9dea6b881d1a95185a02463df25ce53" }, "downloads": -1, "filename": "elkm1_lib-0.7.6.tar.gz", "has_sig": false, "md5_digest": "eec93b034d484c36d98fa4ae6cca86a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29022, "upload_time": "2018-08-31T17:07:06", "url": "https://files.pythonhosted.org/packages/5e/20/268cb6f354d038e9eb15a56bb3debda9a469e59398f4d67e78069ae05809/elkm1_lib-0.7.6.tar.gz" } ], "0.7.7": [ { "comment_text": "", "digests": { "md5": "b6dfffd0cc70612d22c47d299e40a037", "sha256": "37b4a368d73779bb3ba9e343cb43fd63e79edc82d65762d2a672d4033c19dd8c" }, "downloads": -1, "filename": "elkm1_lib-0.7.7.tar.gz", "has_sig": false, "md5_digest": "b6dfffd0cc70612d22c47d299e40a037", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29029, "upload_time": "2018-09-01T17:39:47", "url": "https://files.pythonhosted.org/packages/34/7a/9b43cad63d0837477df34567dfd7ee20938e4c0185e0765dc468fd567fc6/elkm1_lib-0.7.7.tar.gz" } ], "0.7.8": [ { "comment_text": "", "digests": { "md5": "96158b3efa1e7b4a093325fefd4ec54b", "sha256": "3ee426dfebbb870ac185ad62b7bd041352b3404de4b8c8d94481ee2f77e80ee4" }, "downloads": -1, "filename": "elkm1_lib-0.7.8.tar.gz", "has_sig": false, "md5_digest": "96158b3efa1e7b4a093325fefd4ec54b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29183, "upload_time": "2018-09-04T20:03:54", "url": "https://files.pythonhosted.org/packages/22/f8/d81f8ca0ce70b701dde37807749522bf93f4641eb35a82e30d19475cc1cb/elkm1_lib-0.7.8.tar.gz" } ], "0.7.9": [ { "comment_text": "", "digests": { "md5": "053f978b5c257539fe98a8db19288d89", "sha256": "999674e846a36f1bbf7f99c49dd7037f6011949eddabc4fa73e6a77c94eb23ab" }, "downloads": -1, "filename": "elkm1_lib-0.7.9.tar.gz", "has_sig": false, "md5_digest": "053f978b5c257539fe98a8db19288d89", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 29557, "upload_time": "2018-09-13T01:55:43", "url": "https://files.pythonhosted.org/packages/f6/f5/1b9c281376b631bd58f3b8a98ec8d4f292dcbe0864e68c358125c6acad56/elkm1_lib-0.7.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f47f1b3db2446b15d5eac37e64e9ad3a", "sha256": "c3a8bea298df6afe72a22a65cf81acddf848d4a681794d1006d72747ac69537e" }, "downloads": -1, "filename": "elkm1_lib-0.7.15-py3-none-any.whl", "has_sig": false, "md5_digest": "f47f1b3db2446b15d5eac37e64e9ad3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 92109, "upload_time": "2019-03-31T16:16:47", "url": "https://files.pythonhosted.org/packages/92/f9/3788fab22b32034c5a63dfd3f1595af7c76de1eb42473b48d573390ae7dc/elkm1_lib-0.7.15-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df1353eba8add547246888dff4f9ca9e", "sha256": "22132b3b979c027959771bc883e3287aed45171edc7f9311a74d1ab419f28432" }, "downloads": -1, "filename": "elkm1-lib-0.7.15.tar.gz", "has_sig": false, "md5_digest": "df1353eba8add547246888dff4f9ca9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 30170, "upload_time": "2019-03-31T16:16:45", "url": "https://files.pythonhosted.org/packages/aa/f9/4b5f1ff4d0fd4f0164004f8eea4baafbc7d8f624eaa3ae9538539a4bf141/elkm1-lib-0.7.15.tar.gz" } ] }