From aa5587f9e19444d33aae379e8f9dcadc1d2cad30 Mon Sep 17 00:00:00 2001 From: Robert Jaakke Date: Mon, 8 Jun 2020 08:58:38 +0200 Subject: [PATCH] Mover begin() to detect function --- tasmota/xsns_73_hp303b.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/xsns_73_hp303b.ino b/tasmota/xsns_73_hp303b.ino index 926a437ad..abff91f09 100644 --- a/tasmota/xsns_73_hp303b.ino +++ b/tasmota/xsns_73_hp303b.ino @@ -49,8 +49,6 @@ char types[7] = "HP303B"; bool HP303B_Read(float &temperature, float &pressure, uint8_t hp303b_address) { - HP303BSensor.begin(hp303b_address); - float t; float p; int16_t ret; @@ -80,6 +78,8 @@ void HP303B_Detect(void) continue; } + HP303BSensor.begin(addresses[i]); + float t; float p; if (HP303B_Read(t, p, addresses[i])) @@ -87,6 +87,7 @@ void HP303B_Detect(void) I2cSetActiveFound(addresses[i], types); address = addresses[i]; type = 1; + break; } } }