diff --git a/exporter/exporter.go b/exporter/exporter.go index 7b9d072..61a2453 100644 --- a/exporter/exporter.go +++ b/exporter/exporter.go @@ -72,6 +72,14 @@ func (we *WeatherExporter) ScrapeHandler(w http.ResponseWriter, r *http.Request) client = weatherflow.NewClient(apiToken, nil, prefixedLogger(apiToken, log.Printf)) we.clients[apiToken] = client client.Start(func(msg weatherflow.Message) { + deviceID, ok := msg.GetDeviceID() + if !ok { + return + } + collector, ok := collectorsForToken[deviceID] + if !ok { + return + } collector.update(msg, apiToken) }) } diff --git a/go.mod b/go.mod index 1264e41..9e9662e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/prometheus/client_golang v1.15.1 - github.com/tris/weatherflow v0.3.0 + github.com/tris/weatherflow v0.3.1 ) require (