Skip to content

Commit

Permalink
Update help and README
Browse files Browse the repository at this point in the history
Because there are labels now (eg. 2323=kitchen 3434=piano)
  • Loading branch information
jckuester committed Sep 1, 2018
1 parent b018a52 commit d2cfd69
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ The logs will show all signals that the exporter is able to decode, but nothing
```

2) Write down all the IDs of sensors you'd like export to Prometheus.
3) Restart the weather station with those IDs (e.g., `./weather-station 2439 2320`)
3) Restart the weather station with those IDs and give each ID a human-readable label (e.g., `./weather-station 2439=kitchen 2320=piano`)

## Dashboards

Expand Down
5 changes: 3 additions & 2 deletions arduino.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"os"

"context"
"github.com/pkg/errors"
"github.com/spf13/afero"
"strings"
"sync"

"github.com/pkg/errors"
"github.com/spf13/afero"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions arduino_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package main

import (
"context"
"strings"
"testing"

"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"strings"
"testing"
)

var deviceFile = "/dev/ttyUSB0"
Expand Down
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ package main

import (
"context"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/alecthomas/kingpin.v2"
"log"
"net/http"
"strings"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/alecthomas/kingpin.v2"
)

var (
device = kingpin.Flag("device", "Arduino connected to USB").
Default("/dev/ttyUSB0").String()
listenAddr = kingpin.Flag("listen-address", "The address to listen on for HTTP requests.").
listenAddr = kingpin.Flag("listen-address", "The address to listen on for HTTP requests").
Default(":8080").String()
ids = kingpin.Arg("ids", "Sensor IDs that will be exported").StringMap()
ids = kingpin.Arg("id=label ...", "List of all sensor IDs (e.g. 1234=kitchen 2353=piano)"+
" that will be exported to prometheus. Each ID must be given a human-readable label.").StringMap()

temperature *prometheus.GaugeVec
humidity *prometheus.GaugeVec
Expand Down
1 change: 1 addition & 0 deletions protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"testing"

"github.com/stretchr/testify/assert"
)

Expand Down
5 changes: 3 additions & 2 deletions pulse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package main

import (
"fmt"
"github.com/bradfitz/slice"
"github.com/pkg/errors"
"math"
"sort"
"strconv"
"strings"

"github.com/bradfitz/slice"
"github.com/pkg/errors"
)

// Signal implements a received 433 MHz signal of compressed raw time series
Expand Down

0 comments on commit d2cfd69

Please sign in to comment.