Home Assistant Simple Websocket client
Project description
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.
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:
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:
from HassWS import HassWS
hws = HassWS(server_url='wss://my.hass.url:8123',token='token goes here')
print(hws.send('config/entity_registry/list'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file HassWS-0.0.3.tar.gz.
File metadata
- Download URL: HassWS-0.0.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08094221abb9ee6994247eee42d9c9c03df114b888662c8968c8fd20beec6d6b
|
|
| MD5 |
04117d457757fff75c27fd1ba7c12081
|
|
| BLAKE2b-256 |
8c437fbccd7c7395e6ffdcbead244b56cf06df8987d2c4b8fbce5aba391c7dd9
|
File details
Details for the file HassWS-0.0.3-py3-none-any.whl.
File metadata
- Download URL: HassWS-0.0.3-py3-none-any.whl
- Upload date:
- Size: 1.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069b645f91b133b8b2c62bbbac4a77c9919423ff45d1e8ba5111547681681103
|
|
| MD5 |
cc9e52dde1c36d7bfd2754272587845a
|
|
| BLAKE2b-256 |
3f890a1accf1010b2e348f66e35cb9639c33ef180a5513af4c91f1c0632a00a6
|