HassWS


NameHassWS JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryHome Assistant Simple Websocket client
upload_time2023-04-18 09:10:58
maintainer
docs_urlNone
authorAlexMKX
requires_python
licenseBSD 3-Clause License
keywords homeassistant
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Home Assistant WebSocket wrapper

The purpose of this module is to allow to execute synchronous calls to Home Assistant WebSocket API.

It is based on [Home Assistant WebSocket API](https://developers.home-assistant.io/docs/api/websocket/).

It uses synchronouse calls and short-lived connections. Which means each call will open a new connection, execute the call and close the connection.
this is way simple and fast in development, but not very efficient in terms of performance. However, it is good enough for most of the cases especially scripting the HomeAssistant.
## Usage

You can either use it with AppDaemon or without.

With AppDaemon the token and server information will be configured automatically: 
```python
from HassWS import HassWS


class appdaemon_app(hass.Hass):
    hws: HassWS

    def initialize(self):
        self.hws = HassWS(hass_instance=self)
        self.log(self.hws.send('config/entity_registry/list'))
```

Or without AppDaemon:
```python
from HassWS import HassWS

hws = HassWS(server_url='wss://my.hass.url:8123',token='token goes here')
print(hws.send('config/entity_registry/list'))
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "HassWS",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "HomeAssistant",
    "author": "AlexMKX",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8c/43/7fbccd7c7395e6ffdcbead244b56cf06df8987d2c4b8fbce5aba391c7dd9/HassWS-0.0.3.tar.gz",
    "platform": null,
    "description": "# Home Assistant WebSocket wrapper\n\nThe purpose of this module is to allow to execute synchronous calls to Home Assistant WebSocket API.\n\nIt is based on [Home Assistant WebSocket API](https://developers.home-assistant.io/docs/api/websocket/).\n\nIt uses synchronouse calls and short-lived connections. Which means each call will open a new connection, execute the call and close the connection.\nthis is way simple and fast in development, but not very efficient in terms of performance. However, it is good enough for most of the cases especially scripting the HomeAssistant.\n## Usage\n\nYou can either use it with AppDaemon or without.\n\nWith AppDaemon the token and server information will be configured automatically: \n```python\nfrom HassWS import HassWS\n\n\nclass appdaemon_app(hass.Hass):\n    hws: HassWS\n\n    def initialize(self):\n        self.hws = HassWS(hass_instance=self)\n        self.log(self.hws.send('config/entity_registry/list'))\n```\n\nOr without AppDaemon:\n```python\nfrom HassWS import HassWS\n\nhws = HassWS(server_url='wss://my.hass.url:8123',token='token goes here')\nprint(hws.send('config/entity_registry/list'))\n```\n\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "Home Assistant Simple Websocket client",
    "version": "0.0.3",
    "split_keywords": [
        "homeassistant"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f890a1accf1010b2e348f66e35cb9639c33ef180a5513af4c91f1c0632a00a6",
                "md5": "cc9e52dde1c36d7bfd2754272587845a",
                "sha256": "069b645f91b133b8b2c62bbbac4a77c9919423ff45d1e8ba5111547681681103"
            },
            "downloads": -1,
            "filename": "HassWS-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cc9e52dde1c36d7bfd2754272587845a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1783,
            "upload_time": "2023-04-18T09:10:57",
            "upload_time_iso_8601": "2023-04-18T09:10:57.770219Z",
            "url": "https://files.pythonhosted.org/packages/3f/89/0a1accf1010b2e348f66e35cb9639c33ef180a5513af4c91f1c0632a00a6/HassWS-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c437fbccd7c7395e6ffdcbead244b56cf06df8987d2c4b8fbce5aba391c7dd9",
                "md5": "04117d457757fff75c27fd1ba7c12081",
                "sha256": "08094221abb9ee6994247eee42d9c9c03df114b888662c8968c8fd20beec6d6b"
            },
            "downloads": -1,
            "filename": "HassWS-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "04117d457757fff75c27fd1ba7c12081",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2933,
            "upload_time": "2023-04-18T09:10:58",
            "upload_time_iso_8601": "2023-04-18T09:10:58.901455Z",
            "url": "https://files.pythonhosted.org/packages/8c/43/7fbccd7c7395e6ffdcbead244b56cf06df8987d2c4b8fbce5aba391c7dd9/HassWS-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-18 09:10:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "hassws"
}
        
Elapsed time: 0.06234s