more homeassistant controls

This commit is contained in:
htpc 2026-02-17 10:03:23 -08:00
parent f4b2f0ab77
commit 6085469a47
3 changed files with 24 additions and 14 deletions

7
cec.sh
View file

@ -2,14 +2,19 @@
tv_on() {
cec-ctl --to 0 --image-view-on
#xrandr --output HDMI-A-0 --mode 1920x1080
xrandr --output HDMI-A-0 --auto; sleep 3; xrandr --output HDMI-A-0 --mode 1920x1080
echo "on">~/scripts/PJ/tv_state
curl -X POST -d '' $REPORT_TV_ON
}
tv_off() {
cec-ctl --to 0 --standby
echo "off">~/scripts/PJ/tv_state
curl -X POST -d '' $REPORT_TV_OFF
}
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$ROOT/.env"
if [[ -z "$1" ]]; then
if grep -q off ~/scripts/PJ/tv_state; then
tv_on