This commit is contained in:
2023-12-11 23:38:52 -06:00
parent 84396ad108
commit 6b5ee4ae0b
3 changed files with 29 additions and 15 deletions

View File

@@ -95,7 +95,7 @@ $(date)"
fi
fi
logtime=$(expr `date +%s` - $(stat -f %m ${PW_LOGPOWER}))
if [ ${logtime} -ge $(echo "scale=2; ${PW_LOG_INTERVAL_NORMAL}*60" | bc) ] || ([ ${OFFSITE_BATT_CAP%.*} -lt 100 ] && [ ${logtime} -gt ${PW_LOG_INTERVAL_CHARGING} ]); then
if [ ${logtime} -ge $(echo "scale=0; ${PW_LOG_INTERVAL_NORMAL}*60" | bc) ] || ([ ${OFFSITE_BATT_CAP%.*} -lt 100 ] && [ ${logtime} -gt ${PW_LOG_INTERVAL_CHARGING} ]); then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}'% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Normal" >> ${PW_LOGPOWER}
fi
else