specific message for each Bosch sensor

This commit is contained in:
Ollo 2021-12-12 15:28:24 +01:00
parent b91317fae2
commit 5e27d3ebf4
2 changed files with 12 additions and 3 deletions

View File

@ -12,7 +12,7 @@
platform = espressif8266
board = d1_mini
framework = arduino
build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -D BMP280
build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -DBMP280
; build_flag needs define the Bosch sensor...
; -D BMP280
;or

View File

@ -224,8 +224,17 @@ void onHomieEvent(const HomieEvent &event)
case HomieEventType::MQTT_READY:
mConnected=true;
if (mFailedI2Cinitialization) {
log(MQTT_LEVEL_DEBUG, F("Could not find a valid BME680 sensor, check wiring or "
"try a different address!"), MQTT_LOG_I2CINIT);
log(MQTT_LEVEL_DEBUG,
#ifdef BME680
"Could not find a valid BME680 sensor, check wiring or try a different address!"
#else
#ifdef BMP280
"Could not find a valid BMP280 sensor, check wiring or try a different address!"
#else
"no I2C sensor defined"
#endif
#endif
, MQTT_LOG_I2CINIT);
} else {
log(MQTT_LEVEL_INFO, F("BME680 sensor found"), MQTT_LOG_I2CINIT);
}