aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7026f3d8968b1ef03478d35637d9eb50b29564c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!--
SPDX-FileCopyrightText: 2020 Ethel Morgan

SPDX-License-Identifier: CC0-1.0
-->

# Kiki's Dispatch Service

A Webook & MQTT dispatch server.

## Config

For example,

```json
{
  "rules": {
    "update Catbus UI": {
      "triggers": [
        {
          "url": "/gitolite-repo-updated",
          "formValues": {
            "repo": "catbus-web-ui"
          }
        }
      ],
      "actions": [
        {
          "url": "https://build.eth.moe/deploy",
          "formValues": {
            "project": "catbus-web-ui"
          }
        }
      ]
    },
    "turn lights on": {
      "triggers": [
        {
          "url": "/living-room/lights-on",
          "formValues": {
            "power": "on"
          }
        }
      ],
      "actions": [
        {
          "mqtt": "tcp://catbus.eth.moe/home/living-room/sofa-light/power",
          "value": "on"
        },
        {
          "mqtt": "tcp://catbus.eth.moe/home/living-room/front-light/power",
          "value": "on"
        }
      ]
    }
  }
}
```