do not send alerts when there are no metrics

This commit is contained in:
Joerg Lehmann 2021-04-17 17:30:37 +02:00
parent efc9864613
commit dac9b4ac2f
1 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,8 @@ func vbat2percent(vbat string) int {
func getLastMetrics(deveui string) OneMetric { func getLastMetrics(deveui string) OneMetric {
var res OneMetric var res OneMetric
res.BatteryPercent = "999"
url := "http://localhost:8086/api/v2/query?org=wobischorg" url := "http://localhost:8086/api/v2/query?org=wobischorg"
data := []byte(fmt.Sprintf(`from(bucket:"wobischbucket") data := []byte(fmt.Sprintf(`from(bucket:"wobischbucket")
|> range(start:-5d) |> range(start:-5d)