#!/bin/bash
export PATH=$PATH:/usr/bin/local
cname=`scutil --get ComputerName`

echo ""
echo "!!** dactoggle **!!"
echo "------------------------------------------------------------------------"
echo "Machine:" $cname
echo `date`
echo ""

# machine specific: Angus && Petula, turn off HomeKit stuff
if [ $cname = "Angus" ];
then
  open -g "homecontrol://x-callback-url/run-action?action-type=switch-device-status&item-type=device&item-name=Office%20Plug%20A1&room-name=South%20Office&home-name=Holland%20Main&activation-mode=toggle&authentication-token=Ew2r577TQShzrOH3Cmfew"
elif [ $cname = "Petula" ];
then
  open -g "homecontrol://x-callback-url/run-action?action-type=switch-device-status&item-type=device&item-name=Mac%20Studio%20DAC%20Switch&room-name=North%20Office&home-name=Holland%20Main&activation-mode=toggle&authentication-token=Ew2r577TQShzrOH3Cmfew"
else
  echo "** Not on Angus or Petula **"
fi