mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 12:27:13 +01:00
Use NAN values for TSL2591 saturation (#3931)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
0b0984f9a0
commit
b76c7a0131
@ -347,8 +347,8 @@ float TSL2591Component::get_calculated_lux(uint16_t full_spectrum, uint16_t infr
|
|||||||
uint16_t max_count = (this->integration_time_ == TSL2591_INTEGRATION_TIME_100MS ? 36863 : 65535);
|
uint16_t max_count = (this->integration_time_ == TSL2591_INTEGRATION_TIME_100MS ? 36863 : 65535);
|
||||||
if ((full_spectrum == max_count) || (infrared == max_count)) {
|
if ((full_spectrum == max_count) || (infrared == max_count)) {
|
||||||
// Signal an overflow
|
// Signal an overflow
|
||||||
ESP_LOGW(TAG, "Apparent saturation on TSL2591 (%s). You could reduce the gain.", this->name_);
|
ESP_LOGW(TAG, "Apparent saturation on TSL2591 (%s). You could reduce the gain or integration time.", this->name_);
|
||||||
return -1.0F;
|
return NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((full_spectrum == 0) && (infrared == 0)) {
|
if ((full_spectrum == 0) && (infrared == 0)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user