Skip to content

Commit c64664c

Browse files
author
Mathias Perlet
committed
Updates README, gofmt
1 parent 61ba29a commit c64664c

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,11 @@ Usage: ./huevent [OPTIONS]
5858
| | lightlevel | xxxxx | Lightlevel (0 ~ dark, 20000 ~ normal, 40000 ~ very bright) |
5959

6060

61-
62-
## Build
63-
64-
```
65-
git clone https://github.com/mperlet/huevent.git && cd huevent
66-
docker run --rm -v "$PWD":/huevent:Z -w /huevent -e GOOS=linux -e GOARCH=amd64 golang:1.12.1-stretch go build huevent.go
67-
```
68-
6961
## Configuration
7062

7163
Run `huevent -pair` to pair a local Hue Bridge.
7264

73-
74-
```
75-
# Press Hue Bridge Button before you ran these commands
76-
BRIDGE_IP=$(curl https://www.meethue.com/api/nupnp -s | grep -E -o "([0-9]{1,3}[.]){3}[0-9]{1,3}")
77-
USERNAME=$(curl -s -X POST -d'{"devicetype":"huevent"}' "http://$BRIDGE_IP/api" | grep -P -o '":"(.*)"' | cut -d '"' -f3)
78-
79-
echo "$BRIDGE_IP $USERNAME"
80-
81-
```
82-
83-
## Configfile
65+
### Configfile
8466

8567
`config`: Hue Bridge IP with Token
8668

@@ -116,6 +98,23 @@ hooks:
11698
deviceFilter: []
11799
```
118100

101+
### Manual Pairing
102+
103+
```
104+
# Press Hue Bridge Button before you ran these commands
105+
BRIDGE_IP=$(curl https://www.meethue.com/api/nupnp -s | grep -E -o "([0-9]{1,3}[.]){3}[0-9]{1,3}")
106+
USERNAME=$(curl -s -X POST -d'{"devicetype":"huevent"}' "http://$BRIDGE_IP/api" | grep -P -o '":"(.*)"' | cut -d '"' -f3)
107+
108+
echo "$BRIDGE_IP $USERNAME"
109+
110+
```
111+
112+
## Build
113+
114+
```
115+
git clone https://github.com/mperlet/huevent.git && cd huevent
116+
docker run --rm -v "$PWD":/huevent:Z -w /huevent -e GOOS=linux -e GOARCH=amd64 golang:1.12.4-stretch go build huevent.go
117+
```
119118

120119
## Examples
121120

huevent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"encoding/json"
66
"flag"
77
"fmt"
8+
"gopkg.in/yaml.v2"
89
"io/ioutil"
910
"log"
1011
"net/http"
1112
"os"
1213
"os/exec"
1314
"path"
1415
"time"
15-
"gopkg.in/yaml.v2"
1616
)
1717

1818
type config struct {
@@ -40,7 +40,7 @@ type HueventConfig struct {
4040
type Hook struct {
4141
DeviceID string `yaml:"deviceId"`
4242
EventType string `yaml:"eventType"`
43-
TriggerOn string `yaml:"triggerOn,omitempty"`
43+
TriggerOn string `yaml:"triggerOn,omitempty"`
4444
Cmd string `yaml:"cmd"`
4545
}
4646

0 commit comments

Comments
 (0)