Fix misdetection of current generation TSL2591 (#23699)

* Update xsns_11_veml6070.ino

in Veml6070Detect check for the presence of both addresses in the bus to avoid misdetection of ATH20/21 (anyone with the device, please confirm this change still detect the device when present)

* Update xsns_16_tsl2561.ino

check the correct ID was returned to avoid misdetection of other sensors.

* Update xsns_57_tsl2591.ino - report channel values in JSON as in TSL2561

Add the raw infrared and broadband channels of the sensor to the JSON report like is done in the driver for TSL2561

* Update xsns_57_tsl2591.ino

Fix var name

* Update xsns_57_tsl2591.ino

Fix variable name

* Fix to correctly detect all known chip versions

Fix do deal with the current generation of the chip that returns 5 is ID
This commit is contained in:
Pedro Ribeiro 2025-07-17 18:46:22 +01:00 committed by GitHub
parent 60d59fde09
commit f106eb3324
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,7 +75,8 @@ void Tsl2561Detect(void)
if (!Tsl.id(id)) return; if (!Tsl.id(id)) return;
// check the correct ID was returned // check the correct ID was returned
// datasheet says reg 0xA (ID) returns 0x1r (r = nibble revision) // datasheet says reg 0xA (ID) returns 0x1r (r = nibble revision)
if ((id & 0xF0) != 0x10) return; // current version returns 0x5r
if ((id & 0xF0) != 0x10 && (id & 0xF0) != 0x50) return;
if (Tsl.on()) { if (Tsl.on()) {
tsl2561_type = 1; tsl2561_type = 1;
I2cSetActiveFound(Tsl.address(), tsl2561_types); I2cSetActiveFound(Tsl.address(), tsl2561_types);