From 042433e5aaa2226b373282c5838bc86d78a3c0a3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 6 Nov 2023 10:05:34 -0600 Subject: [PATCH] Update offsite-power-check.sh --- offsite-power-check.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/offsite-power-check.sh b/offsite-power-check.sh index ae2f9aac..36945f04 100755 --- a/offsite-power-check.sh +++ b/offsite-power-check.sh @@ -56,6 +56,15 @@ $(date)" fi if [ ${OFFSITE_VOLTIN%.*} -gt 105 ]; then + if [ "${charging}" == "true" ] && [ ${OFFSITE_BATT_CAP%.*} -eq 100 ]; then + echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Charging Complete" >> ${PW_LOGFILE} + SENDNOTICE "OFFSITE POWER" "Batteries are fully recharged" + charging=false + elif [ ${OFFSITE_BATT_CAP%.*} -lt 100 ]; then + charging=true + else + charging=false + fi if [ -f ${PW_TMPFOLDER}/power.offsite.ac.low ]; then if [ -f ${PW_TMPFOLDER}/power.offsite.off ]; then echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Offsite Power Restored" >> ${PW_LOGFILE}