V0.1 release #11

Merged
kelly merged 19 commits from v0.1 into main 2026-06-02 20:49:08 -05:00
2 changed files with 59 additions and 40 deletions
Showing only changes of commit 998f639a55 - Show all commits
+18
View File
@@ -3,6 +3,7 @@
[string] $dtAPIKey = $ENV:DONETICKAPIKEY [string] $dtAPIKey = $ENV:DONETICKAPIKEY
[string] $appriseWebhookURL = $ENV:APPRISEWEBHOOKURL [string] $appriseWebhookURL = $ENV:APPRISEWEBHOOKURL
[string] $appriseWebhookTag = $ENV:APPRISEWEBHOOKTAG [string] $appriseWebhookTag = $ENV:APPRISEWEBHOOKTAG
[int[]] $notificationTimes = $ENV:NOTIFICATIONTIMES | Sort-Object
function Send-Notification function Send-Notification
@@ -50,6 +51,7 @@ function Get-Chores
} }
} }
while ($true) {
$today = (Get-Date "23:59:59") $today = (Get-Date "23:59:59")
$chores = Get-Chores $chores = Get-Chores
@@ -101,3 +103,19 @@ if ($todaysTasks.Count -ne 0)
} }
Send-Notification -title "TODAY'S TASKS" -content $content Send-Notification -title "TODAY'S TASKS" -content $content
} }
Write-Host "Finding next notification time..."
foreach($time in $notificationTimes)
{
$now = Get-Date
$diff = $now.Hour - $time
if ($diff -lt 0) # next notification time
{
Write-Host "Next notification time is $time`:00"
$sleepTime = ($diff * -1) * 60
Write-Host "Sleeping for $sleepTime seconds"
Start-Sleep -Seconds $sleepTime
continue # leave loop
}
}
}
+1
View File
@@ -10,3 +10,4 @@ services:
- DONETICKAPIKEY=adminpass # donetick API key - DONETICKAPIKEY=adminpass # donetick API key
- APPRISEWEBHOOKURL=https://apprisehost/notify/config # apprise notification url - APPRISEWEBHOOKURL=https://apprisehost/notify/config # apprise notification url
- APPRISEWEBHOOKTAG=all # apprise notification tag - APPRISEWEBHOOKTAG=all # apprise notification tag
- NOTIFICATIONTIMES=8,12,17 # hours when notifications will be sent