Add Human Activity Sensor
This commit is contained in:
+12
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user