battery type should be unsigned

This commit is contained in:
Jeffrey C. Ollie 2021-02-27 08:18:53 -06:00
parent 2095a29c53
commit a1cdaf9b18
Signed by: jeff
GPG key ID: 6F86035A6D97044E

View file

@ -88,7 +88,7 @@ func ParseCleargrassSensorData(writeAPI *influxdb2_api.WriteAPI, logger *zap.Log
continue
}
battery := int(eventData[0])
battery := uint8(eventData[0])
point := influxdb2.NewPointWithMeasurement("battery")
point.SetTime(timestamp)
@ -108,7 +108,7 @@ func ParseCleargrassSensorData(writeAPI *influxdb2_api.WriteAPI, logger *zap.Log
zap.String("description", description),
zap.String("measurement", "battery"),
zap.String("measurement_unit", "%"),
zap.Int("value", battery))
zap.Uint8("value", battery))
default:
logger.Warn("unknown event type",