Author: | Henri Dwyer |
---|
PyHomeKit is a set of python libraries that let you control HomeKit compatible accessories, both BLE and HTTP.
Important
PyHomeKit is currently in pre-alpha. Many features are not yet implemented or broken.
Connect to a HAP characteristics and view its signature:
import pyhomekit
device_mac = "aa:aa:aa:aa:aa"
characteristic_uuid = "00000000-0000-0000-0000-000000000000"
accessory = pyhomekit.ble.HapAccessory(device_mac, 'random')
accessory.connect()
hap_characteristic = pyhomekit.ble.HapCharacteristic(accessory=accessory, uuid=characteristic_uuid)
print(hap_characteristic.signature)
View the debug logs in stdout:
import logging
logging.basicConfig()
logging.getLogger('pyhomekit').setLevel(logging.DEBUG)
pyHomeKit
is on Pypi, so you can pip
install it:
pip install pyhomekit
If you want to install from source, clone the repository:
git clone git://github.com/henridwyer/pyhomekit.git
cd pyhomekit
pip install -r requirements.txt
pip install -e .
Then you can build the documentation:
make doc
And run the tests:
make tests
For more information about HomeKit, see the Apple Developper HomeKit page.
Bluetooth Low Energy device compatibility is provided by bluepy.
Encryption is provided by the libsodium library.