'Apple TV Movie State')
case $characteristic in
'On')
# Get Apple TV play status
ATV_PLAYING=$(atvremote --id ${ATV_id} --airplay-credentials ${airplay_credentials} playing )
ATV_PLAYING_STATE=$(echo "$ATV_PLAYING" | grep -oP '(?<=Device state: ).*')
ATV_PLAYING_MOVIE=$(echo "$ATV_PLAYING" | grep -oP '(?<=Media type: ).*')
if [ "${ATV_PLAYING_STATE}" = "Playing" ]
then
if [ "${ATV_PLAYING_MOVIE}" = "Video" ]
then
printf "1\n"
else
printf "0\n"
fi
else
printf "0\n"
fi
exit 0
;;
*)
printf "UnHandled Get ${device} Characteristic ${characteristic}\n"
exit -1
;;
esac
exit 0
;;
Set command can be copied from 'Apple TV Playing State'
Here is an additional video playing status:
Set command can be copied from 'Apple TV Playing State'