ble-sensors/lib/xiaomi/scale/scale_v1.go
Jeffrey C. Ollie 6fa0a57a20
Some checks failed
continuous-integration/drone/push Build is failing
change influxdb2 schema
2020-08-13 00:46:28 -05:00

21 lines
721 B
Go

package scale
import (
"time"
"github.com/go-ble/ble"
influxdb2_api "github.com/influxdata/influxdb-client-go/api"
"go.uber.org/zap"
)
// XiaomiScaleV1UUID is BLE UUID for Xiaomi Scale V1
var XiaomiScaleV1UUID ble.UUID = []byte{0x1d, 0x18}
// ParseXiaomiScaleV1 parses V1 scale service data
func ParseXiaomiScaleV1(writeAPI *influxdb2_api.WriteAPI, logger *zap.Logger, timestamp time.Time, detector string, description string, advertisement ble.Advertisement, index int, sd ble.ServiceData) {
logger.Info("xiaomi v1 scale",
zap.String("source", advertisement.Addr().String()),
zap.String("description", description),
zap.String("name", advertisement.LocalName()),
zap.String("uuid", sd.UUID.String()))
}