Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
cflurin committed Apr 14, 2016
1 parent b7cfa9d commit addd6ea
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ The message is a JSON object with this structure:
{topic: <function>, payload: {<data>}}
```

`input`: the websocket-client sends a message to homebridge-websocket.
`output`: the websocket-client sends a message to homebridge-websocket.

`input`: homebridge-websocket sends a message to the websocket-client.

`output`: homebridge-websocket sends a message to the websocket-client.

Howto examples:

**addAccessory (input)**
**addAccessory (output)**

```sh
{topic: "add", payload: {"name": "flex_lamp", "service": "Switch"}}
Expand All @@ -78,7 +79,7 @@ After the new accessory is added homebridge-websocket sends an acknowledge messa
{"topic":"response", "payload": {"ack": true, "message": "accessory 'flex_lamp' is added."}}
```

**removeAccessory (input)**
**removeAccessory (output)**

```sh
{topic: "remove", payload: {"name": "flex_lamp"}}
Expand All @@ -90,27 +91,27 @@ After the accessory is removed homebrdge sends an acknowledge message:
{"topic":"response", "payload": {"ack": true, "message": "accessory 'flex_lamp' is removed."}}
```

**setValue (input)**
**setValue (output)**

```sh
{topic: "setValue", payload: {"name": "flex_lamp", "characteristic": "On", "value": true}}
```

**set (output)**
**set (input)**

```sh
{topic: "set", payload: {"name": "flex_lamp", "characteristic": "On", "value": true}}
```

**get (output)**
**get (input)**

```sh
{topic: "get", payload: {"name": "flex_lamp", "characteristic": "On"}}
```

When hoembridge-websocket sends a `get` topic it expects a callback with the value within 2 seconds.

**callback (input)**
**callback (output)**

```sh
{topic: "callback", payload: {"name": "flex_lamp", "characteristic": "On", "value": true}}
Expand Down

0 comments on commit addd6ea

Please sign in to comment.