Skip to content

Commit

Permalink
Merge pull request #116 from anarsoul/xiron-humidity-clamp
Browse files Browse the repository at this point in the history
Plugin_046: Xiron: don't reject the measurement if humidity is > 100%
  • Loading branch information
cpainchaud authored Aug 8, 2024
2 parents ef56edf + fc23cb7 commit 94484aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions RFLink/Plugins/Plugin_046.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* E = Always 1111 ?
* F = Always 0000 0000 ?
*
* Xiron Message Format:
* Xiron Message Format (also known as Nexus-TH in other sources):
* 01101110 10 00 000011101101 1111 00110011
* AAAAAAAA BB CC DDDDDDDDDDDD EEEE FFFFFFFF
* ID ?? Ch Temperature ? Humidity
Expand Down Expand Up @@ -178,8 +178,10 @@ boolean Plugin_046(byte function, const char *string)
}
if (type == 1)
{
if (humidity > 100)
return false; // humidity out of range ( > 100)
// Certain sensors return humidity higher than 100% when the sensor is saturated.
// Clamp it to 99% instead of rejecting the measurement
if (humidity >= 100)
humidity = 99;
}
//==================================================================================
// Output
Expand Down

0 comments on commit 94484aa

Please sign in to comment.