From b436f47786fc344f0d0a67cee7fd14c185af7c7c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 11 Nov 2019 11:44:40 +0100 Subject: [PATCH] Remove on-the-fly LM75AD detection Remove on-the-fly LM75AD detection (#6825) --- tasmota/xsns_26_lm75ad.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasmota/xsns_26_lm75ad.ino b/tasmota/xsns_26_lm75ad.ino index ea5f656eb..da66a2445 100644 --- a/tasmota/xsns_26_lm75ad.ino +++ b/tasmota/xsns_26_lm75ad.ino @@ -45,7 +45,7 @@ #define LM75_THYST_REGISTER 0x02 #define LM75_TOS_REGISTER 0x03 -uint8_t lm75ad_type = 0; +bool lm75ad_type = false; uint8_t lm75ad_address; uint8_t lm75ad_addresses[] = { LM75AD_ADDRESS1, LM75AD_ADDRESS2, LM75AD_ADDRESS3, LM75AD_ADDRESS4, LM75AD_ADDRESS5, LM75AD_ADDRESS6, LM75AD_ADDRESS7, LM75AD_ADDRESS8 }; @@ -59,7 +59,7 @@ void LM75ADDetect(void) uint16_t buffer; if (I2cValidRead16(&buffer, lm75ad_address, LM75_THYST_REGISTER)) { if (buffer == 0x4B00) { - lm75ad_type = 1; + lm75ad_type = true; I2cSetActiveFound(lm75ad_address, "LM75AD"); break; } @@ -110,9 +110,6 @@ bool Xsns26(uint8_t function) bool result = false; switch (function) { - case FUNC_EVERY_SECOND: - LM75ADDetect(); - break; case FUNC_JSON_APPEND: LM75ADShow(1); break; @@ -121,6 +118,9 @@ bool Xsns26(uint8_t function) LM75ADShow(0); break; #endif // USE_WEBSERVER + case FUNC_INIT: + LM75ADDetect(); + break; } return result; }