Skip to content

Instantly share code, notes, and snippets.

@dnicolson
Created January 18, 2020 16:30
Show Gist options
  • Save dnicolson/8d679870ba8a75309a3a5e34b6eb8a4e to your computer and use it in GitHub Desktop.
Save dnicolson/8d679870ba8a75309a3a5e34b6eb8a4e to your computer and use it in GitHub Desktop.
Control a HomeKit lightbulb from the Touch Bar with this Quick Action (requires getting the pairing keys from the Keychain)
PYTHON=/Users/dave/.asdf/shims/python3
STATUS=`$PYTHON -m homekit.get_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13`
if [[ "$STATUS" =~ "true" ]]; then
$PYTHON -m homekit.put_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13 false
else
$PYTHON -m homekit.put_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13 true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment