summarylogtreecommitdiffstats
path: root/homeassistant-printerqueue.sh
blob: 7438033dbec36b02ef470835bb05529fe2eed434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/bash

echo "Starting..."
echo "Device: ${device}"
echo "Printer: ${printer}"
echo "Server: ${server}"

while [ true ]
do
queue="$(lpq -P ${printer})"
echo "$queue" | grep -q -- "no entries"
status="$?"

if [ $status -ne 0 ]
then
hass-cli --server ${server} state turn_on ${device}
fi

sleep 5

done