Skip to content

Commit

Permalink
Update WeatherSensor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Jul 16, 2023
1 parent 8e78822 commit 2763539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ DecodeStatus WeatherSensor::decodeBresser6In1Payload(uint8_t *msg, uint8_t msgSi
sensor[slot].humidity = (msg[14] >> 4) * 10 + (msg[14] & 0x0f);

// apparently ff01 or 0000 if not available, ???0 if valid, inverted BCD
uv_ok = (~msg[15] & 0xff) <= (0x99 && (~msg[16] & 0xf0) <= 0x90) && !f_3in1;
uv_ok = ((~msg[15] & 0xff) <= 0x99) && ((~msg[16] & 0xf0) <= 0x90) && !f_3in1;
if (uv_ok) {
int uv_raw = ((~msg[15] & 0xf0) >> 4) * 100 + (~msg[15] & 0x0f) * 10 + ((~msg[16] & 0xf0) >> 4);
sensor[slot].uv = uv_raw * 0.1f;
Expand Down

0 comments on commit 2763539

Please sign in to comment.