summaryrefslogtreecommitdiff
path: root/script/uactivity/activity/#20-switch_tv
diff options
context:
space:
mode:
authorKeine_Ahnung <dirk-vdr@gmx.de>2013-02-05 20:09:41 +0100
committerKeine_Ahnung <dirk-vdr@gmx.de>2013-02-05 20:09:41 +0100
commitb2316e705cf742ac9e811d3c3e200a8f21547bab (patch)
treede56ee3bee9508cb112119da36a3c439274419ab /script/uactivity/activity/#20-switch_tv
parent2be7e65c7b15775993eeb3198b8c2404b5b489dd (diff)
downloadvdr-plugin-uactivity-b2316e705cf742ac9e811d3c3e200a8f21547bab.tar.gz
vdr-plugin-uactivity-b2316e705cf742ac9e811d3c3e200a8f21547bab.tar.bz2
Added switch_tv_light example, fixed filenames and attributes
Diffstat (limited to 'script/uactivity/activity/#20-switch_tv')
-rwxr-xr-xscript/uactivity/activity/#20-switch_tv38
1 files changed, 38 insertions, 0 deletions
diff --git a/script/uactivity/activity/#20-switch_tv b/script/uactivity/activity/#20-switch_tv
new file mode 100755
index 0000000..c9bbf57
--- /dev/null
+++ b/script/uactivity/activity/#20-switch_tv
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+switch_tv(){
+ if [ "${1}" = "on" ]; then
+ # yaUSBir sometimes ignore the first command, send an existing dummy ir code
+ irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_DUMMY dummy
+ sleep 0.5
+ irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE on
+ else
+ # yaUSBir sometimes ignore the first command, send an existing dummy ir code
+ irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_DUMMY dummy
+ sleep 0.5
+ irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE off
+ fi
+}
+
+
+
+case "${1}" in
+ startup)
+ true
+ ;;
+ started)
+ [ "${2}" = "true" ] && switch_tv on
+ ;;
+ shutdown)
+ switch_tv off
+ ;;
+ running)
+ if [ "${2}" = "true" ]; then
+ switch_tv on
+ else
+ switch_tv off
+ fi
+ ;;
+esac
+
+exit 0