Skip to content

Commit

Permalink
Remove forked MQTT adapter/broker
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-kotikov committed Apr 16, 2020
1 parent d09d5b2 commit b0ccd6f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 251 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ require (
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
gobot.io/x/gobot v1.14.0
gobot.io/x/gobot v1.14.1-0.20200114062503-06429046a55c
google.golang.org/appengine v1.6.5
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45 h1:mACY1anK6HNCZtm/DK2Rf2
go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw=
gobot.io/x/gobot v1.14.0 h1:IJv4A9f5/lUz4JQaS37UW8bRVl3lG+jCGUcNmJ2F0vE=
gobot.io/x/gobot v1.14.0/go.mod h1:cg1GwF1yziEvX5dB09t91t05lf8kwDS6rN90XgcUhK0=
gobot.io/x/gobot v1.14.1-0.20200114062503-06429046a55c h1:vK3XHxAp42BDtncDxxwZDSqeBKu2IfBSCPYwpWqPty4=
gobot.io/x/gobot v1.14.1-0.20200114062503-06429046a55c/go.mod h1:cg1GwF1yziEvX5dB09t91t05lf8kwDS6rN90XgcUhK0=
gocv.io/x/gocv v0.21.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/getsentry/sentry-go"
log "github.com/sirupsen/logrus"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/mqtt"
)

func main() {
Expand All @@ -27,7 +28,7 @@ func main() {

adaptor := NewBluetoothAdapter()
driver := NewMibleDriver(adaptor, cfg.DeviceName, cfg.DeviceAddress)
broker := NewBroker(cfg.BrokerAddress, "Mible")
broker := mqtt.NewAdaptor(cfg.BrokerAddress, "Mible")

unitByChar := map[string]string{
"temperature": "°C",
Expand Down
247 changes: 0 additions & 247 deletions mqtt.go

This file was deleted.

5 changes: 3 additions & 2 deletions sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gobot.io/x/gobot/platforms/mqtt"
)

var (
Expand All @@ -24,15 +25,15 @@ type DiscoPayload struct {

// Sensor represents a single sensor in mible device
type Sensor struct {
broker *Broker
broker *mqtt.Adaptor
name string
char string
unit string
baseTopic string
}

// NewSensor creates a new sensor
func NewSensor(broker *Broker, name, char, unit, baseTopic string) *Sensor {
func NewSensor(broker *mqtt.Adaptor, name, char, unit, baseTopic string) *Sensor {
return &Sensor{
broker: broker,
name: name,
Expand Down

0 comments on commit b0ccd6f

Please sign in to comment.