Add Human Activity Sensor

This commit is contained in:
Dejvino
2020-12-17 20:09:45 +01:00
parent 4208bc54c7
commit 059d555463
8 changed files with 106 additions and 94 deletions
+12
View File
@@ -29,6 +29,17 @@ function pa-volume-loud() {
pa-volume 25
}
function pa-volume-loud-if-inactive() {
LAST_ACTIVE=`human-activity-ago`
if [[ $LAST_ACTIVE > 200 ]]; then
info "Human is inactive. Last activity: $LAST_ACTIVE seconds ago."
pa-volume-loud
else
info "Human is active. Setting only normal volume."
pa-volume-normal
fi
}
function pa-volume-quiet() {
info "Volume set to low"
pa-volume 8
@@ -47,6 +58,7 @@ function pa-shutdown() {
info "PA Shutdown"
pa-power off
pa-volume-normal
killall $PLAYER
}
function pa-announcement() {