#!/bin/sh
#set -x

REMOTE_NAME=blaster
DEVICE=--device=/dev/lircd
SLEEP_TIME="0.2"

for digit in $(echo $1 | sed -e 's/./& /g'); do
  irsend $DEVICE SEND_ONCE $REMOTE_NAME 1_27_KEY_$digit
  sleep $SLEEP_TIME
done

irsend $DEVICE SEND_ONCE $REMOTE_NAME 1_27_KEY_ENTER

#
# If your cable box is slow to change channels, sleep so that Mythtv doesn't
# move forward until after the resolution has changed
#
sleep 1
