Skip to content

A live bird collage card for your Home Assistant dashboard.

new WEEK calculation

Patrick McGuirec8ab077835d7
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh
index af5fdf70..f3e9dd5e 100755
--- a/scripts/birdnet_analysis.sh
+++ b/scripts/birdnet_analysis.sh
@@ -42,7 +42,7 @@ run_analysis() {
### TESTING NEW WEEK CALCULATION
- WEEK_OF_YEAR="$(echo "$(date +%m) * 4" | bc -l)"
+ WEEK_OF_YEAR="$(echo "($(date +%m)-1) * 4" | bc -l)"
DAY_OF_MONTH="$(date +%d)"
if [ ${DAY_OF_MONTH} -le 7 ];then
WEEK="$(echo "${WEEK_OF_YEAR} + 1" |bc -l)"
@@ -50,7 +50,7 @@ run_analysis() {
WEEK="$(echo "${WEEK_OF_YEAR} + 2" |bc -l)"
elif [ ${DAY_OF_MONTH} -le 21 ];then
WEEK="$(echo "${WEEK_OF_YEAR} + 3" |bc -l)"
- elif [ ${DAY_OF_MONTH} -ge 23 ];then
+ elif [ ${DAY_OF_MONTH} -ge 22 ];then
WEEK="$(echo "${WEEK_OF_YEAR} + 4" |bc -l)"
fi