PyHomeKit - HomeKit for Python

Author:Henri Dwyer
https://api.travis-ci.org/henridwyer/pyhomekit.png Latest Version Python Versions

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.

Getting Started

Usage

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)

Installation

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