xperimental / netatmo-exporter

Prometheus exporter for Netatmo sensor data.
MIT License
45 stars 18 forks source link

lastRefreshError is never cleared #10

Closed RichieB2B closed 3 years ago

RichieB2B commented 3 years ago

In RefreshData c.lastRefreshError is set when there is an error (which makes sense) but it is never cleared when there is no error on a next successful RefreshData call. This causes netatmo_up to stay 0 for always and ever after the first error.

# docker logs --timestamps netatmo
2020-11-14T23:09:46.241064323Z level=info msg="Listen on :9210..."
2020-11-14T23:17:52.283248164Z level=error msg="Error during refresh: Bad HTTP return code 504"
2020-11-14T23:26:07.271592987Z level=error msg="Error during refresh: Bad HTTP return code 504"
2020-11-15T04:01:57.511840931Z level=error msg="Error during refresh: Bad HTTP return code 500"
image
xperimental commented 3 years ago

Thanks for the PR, @RichieB2B ! :rocket: