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

@ -224,8 +224,17 @@ void onHomieEvent(const HomieEvent &event)
case HomieEventType::MQTT_READY: case HomieEventType::MQTT_READY:
mConnected=true; mConnected=true;
if (mFailedI2Cinitialization) { if (mFailedI2Cinitialization) {
log(MQTT_LEVEL_DEBUG, F("Could not find a valid BME680 sensor, check wiring or " log(MQTT_LEVEL_DEBUG,
"try a different address!"), MQTT_LOG_I2CINIT); #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 { } else {
log(MQTT_LEVEL_INFO, F("BME680 sensor found"), MQTT_LOG_I2CINIT); log(MQTT_LEVEL_INFO, F("BME680 sensor found"), MQTT_LOG_I2CINIT);
} }