From ef3264ed4576ba7a678ea430faf4c5a63ffd5c9d Mon Sep 17 00:00:00 2001 From: czoczo Date: Sat, 12 Oct 2019 20:36:17 +0200 Subject: [PATCH] added switching input source feature --- yamahactrl.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yamahactrl.sh b/yamahactrl.sh index e0a5de4..ac81720 100755 --- a/yamahactrl.sh +++ b/yamahactrl.sh @@ -37,12 +37,18 @@ power_off() { curl -X POST -d 'Standby' http://$YAMAHA_IP/YamahaRemoteControl/ctrl } +set_input() { +echo "dsfsd $1" + curl -s -X POST -d "HDMI$1" http://$YAMAHA_IP/YamahaRemoteControl/ctrl +} + print_help() { echo -e "Bash script to control Yamaha Amplituner RX-V series." echo -e "Usage: $0 command\n" echo -e "Possible commands:" echo -e " -volup\t\t Set volume up by 1" echo -e " -voldown\t Set volume down by 1" + echo -e " -input \t Set input source 1-4" echo -e " -on\t\t Set power on" echo -e " -off\t\t Set power off" exit 0 @@ -62,6 +68,9 @@ case "$1" in -voldown) volume_down ;; + -input) + set_input "$2" + ;; *) print_help esac