Extend and update API documentation (#4485)

This commit is contained in:
Fabian Affolter 2018-01-21 17:34:44 +01:00 committed by GitHub
parent a7a467065d
commit 1330075f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 66 additions and 9 deletions

View file

@ -17,16 +17,18 @@ Home Assistant contains a WebSocket API. This API can be used to stream informat
Connect your websocket implementation to `ws://localhost:8123/api/websocket`.
If you are not using the [`frontend`](/components/frontend/) in your setup then you need to add the [`websocket_api` component](/components/websocket_api/) to your `configuration.yaml` file to use the WebSocket API.
## {% linkable_title Server states %}
1. Client connects
1. Client connects.
2. Authentication phase starts
- If no further authentication necessary for the user: go to 3
- Server sends `auth_required` message
- Client sends `auth` message
- If no further authentication necessary for the user: go to 3.
- Server sends `auth_required` message.
- Client sends `auth` message.
- If `auth` message correct: go to 3.
- Server sends `auth_invalid`. Go to 6.
3. Send `auth_ok` message
3. Send `auth_ok` message.
4. Authentication phase ends.
5. Command phase starts.
1. Client can send commands.