Skip to content

Commit fa064ae

Browse files
committed
add temp check in bl999
1 parent 0a7f6ba commit fa064ae

File tree

1 file changed

+5
-0
lines changed
  • base_pack/weather_station/protocols

1 file changed

+5
-0
lines changed

base_pack/weather_station/protocols/bl999.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ static bool ws_protocol_bl999_remote_controller(WSBlockGeneric* instance) {
277277
//clear higher bits
278278
sum &= 15;
279279

280+
// limit temperature to valid range for this type of sensor
281+
if (instance->temp < -40.0 || instance->temp > 50.0) {
282+
return false;
283+
}
284+
280285
//returns true if calculated check sum matches received
281286
return sum == nib[9 - 1];
282287

0 commit comments

Comments
 (0)