summaryrefslogtreecommitdiff
path: root/script/uactivity/activity/-20-switch_tv
diff options
context:
space:
mode:
authorKeine_Ahnung <no@mail.com>2013-02-04 14:34:17 +0100
committerKeine_Ahnung <no@mail.com>2013-02-04 14:34:17 +0100
commit055dd9f501c01f49350f3288fdf1ef6af8dc7a10 (patch)
tree81f338311edb1c3abab53e58684ed38fd642828a /script/uactivity/activity/-20-switch_tv
parent7605ff2092460c8c4bfc4cd606bcbd1aeb97b578 (diff)
downloadvdr-plugin-uactivity-055dd9f501c01f49350f3288fdf1ef6af8dc7a10.tar.gz
vdr-plugin-uactivity-055dd9f501c01f49350f3288fdf1ef6af8dc7a10.tar.bz2
added svdrp commands ACTIVE/ALIVE; updated/enhanced examples
Diffstat (limited to 'script/uactivity/activity/-20-switch_tv')
-rw-r--r--script/uactivity/activity/-20-switch_tv20
1 files changed, 17 insertions, 3 deletions
diff --git a/script/uactivity/activity/-20-switch_tv b/script/uactivity/activity/-20-switch_tv
index 7059e1f..c9bbf57 100644
--- a/script/uactivity/activity/-20-switch_tv
+++ b/script/uactivity/activity/-20-switch_tv
@@ -1,11 +1,21 @@
#!/bin/sh
switch_tv(){
- [ "${1}" = "on" ] && irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE on
- [ "${1}" = "off" ] && irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE off
+ 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
@@ -17,7 +27,11 @@ case "${1}" in
switch_tv off
;;
running)
- [ "${2}" = "true" ] && switch_tv on || switch_tv off
+ if [ "${2}" = "true" ]; then
+ switch_tv on
+ else
+ switch_tv off
+ fi
;;
esac