Fixed concatination of strings in logging

This commit is contained in:
Ollo 2021-07-01 22:15:55 +02:00
parent 57d18af76d
commit 456f78042c

View File

@ -415,25 +415,25 @@ int determineNextPump()
if (!plant.isPumpTriggerActive()) if (!plant.isPumpTriggerActive())
{ {
plant.publishState("deactivated"); plant.publishState("deactivated");
log(LOG_LEVEL_DEBUG, String(i + " Skip deactivated pump"), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " Skip deactivated pump"), LOG_DEBUG_CODE);
continue; continue;
} }
if ((rtcLastWateringPlant[i] + plant.getCooldownInSeconds()) > getCurrentTime()) if ((rtcLastWateringPlant[i] + plant.getCooldownInSeconds()) > getCurrentTime())
{ {
plant.publishState("cooldown"); plant.publishState("cooldown");
log(LOG_LEVEL_DEBUG, String(i+" Skipping due to cooldown " + (rtcLastWateringPlant[i] + plant.getCooldownInSeconds())), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " Skipping due to cooldown " + String(rtcLastWateringPlant[i] + plant.getCooldownInSeconds())), LOG_DEBUG_CODE);
continue; continue;
} }
if (!isLowLight && plant.isAllowedOnlyAtLowLight()) if (!isLowLight && plant.isAllowedOnlyAtLowLight())
{ {
plant.publishState("sunny"); plant.publishState("sunny");
log(LOG_LEVEL_DEBUG, String(i+" No pump required: due to light"), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " No pump required: due to light"), LOG_DEBUG_CODE);
continue; continue;
} }
if (plant.getCurrentMoisture() == MISSING_SENSOR) if (plant.getCurrentMoisture() == MISSING_SENSOR)
{ {
plant.publishState("nosensor"); plant.publishState("nosensor");
log(LOG_LEVEL_DEBUG, String(i+" No pump possible: missing sensor"), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " No pump possible: missing sensor"), LOG_DEBUG_CODE);
continue; continue;
} }
if (plant.isPumpRequired()) if (plant.isPumpRequired())
@ -448,13 +448,13 @@ int determineNextPump()
(getCurrentTime() < 10000)) (getCurrentTime() < 10000))
{ {
plant.publishState("active"); plant.publishState("active");
log(LOG_LEVEL_DEBUG, String(i+" Requested pumping"), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " Requested pumping"), LOG_DEBUG_CODE);
pumpToUse = i; pumpToUse = i;
} }
else else
{ {
plant.publishState("after-work"); plant.publishState("after-work");
log(LOG_LEVEL_DEBUG, String(i+" ignored due to time boundary: " + String(plant.getHoursStart()) + " to " + plant.getHoursEnd() + " ( current " + getCurrentHour() + " )"), LOG_DEBUG_CODE); log(LOG_LEVEL_DEBUG, String(String(i) + " ignored due to time boundary: " + String(plant.getHoursStart()) + " to " + String(plant.getHoursEnd()) + " ( current " + String(getCurrentHour()) + " )"), LOG_DEBUG_CODE);
} }
continue; continue;
} }