Skip to content

Commit

Permalink
Fixed validation of rain statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Aug 21, 2024
1 parent 4962a3b commit 0f437c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PayloadBresser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
// Added scanBresser(), modified begin() to trigger scan
// 20240718 Fixed premature return from begin() leading to empty payload
// 20240719 Fixed enabling of all decoders in scanBresser()
// 20240821 Fixed validation of rain statistics
//
// ToDo:
// - Add handling of Professional Rain Gauge
Expand Down Expand Up @@ -417,7 +418,7 @@ void PayloadBresser::encodeWeatherSensor(int idx, uint8_t flags, LoraEncoder &en

// Rain data statistics
#ifdef RAINDATA_EN
if ((idx) && weatherSensor.sensor[idx].valid && weatherSensor.sensor[idx].w.rain_ok)
if ((idx > -1) && weatherSensor.sensor[idx].valid && weatherSensor.sensor[idx].w.rain_ok)
{
if (flags & PAYLOAD_WS_RAIN_H)
{
Expand Down

0 comments on commit 0f437c3

Please sign in to comment.