Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jc2k committed Feb 6, 2020
0 parents commit ff9b712
Show file tree
Hide file tree
Showing 65 changed files with 8,222 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
venv
*.pyc

23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: python
matrix:
include:
- os: linux
dist: xenial
python: 3.5
- os: linux
dist: xenial
python: 3.6
- os: linux
dist: xenial
python: 3.7
- os: osx
language: generic
env: PYTHON=3.5.6

before_install:
- ./.travis/install.sh
script:
- flake8 homekit
- coverage run -m pytest tests/
after_success:
- coveralls
29 changes: 29 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e

echo "OS: $TRAVIS_OS_NAME"

if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# update openssl to a version that is sufficient for cryptography 2.6 (openssl 1.1 is required since)
wget http://launchpadlibrarian.net/400343104/libssl1.1_1.1.0g-2ubuntu4.3_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4.3_amd64.deb
wget http://launchpadlibrarian.net/367327834/openssl_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i openssl_1.1.0g-2ubuntu4_amd64.deb
openssl version
sudo apt-get update;
sudo apt-get install -y build-essential python3-dev libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev;
pip install -r requirements.txt
pip install coveralls
fi

if [ "$TRAVIS_OS_NAME" == "osx" ]; then
# Install Python 3.6.5 directly from brew
brew update
brew uninstall --ignore-dependencies python
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

python3 --version
pip3 --version
pip3 install -r requirements_osx.txt
pip3 install coveralls
fi
Empty file added LICENSE.md
Empty file.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# aiohomekit

This library implements the HomeKit protocol for controlling Homekit accessories using asyncio.

It's primary use is for with Home Assistant. We target the same versions of python as them and try to follow their code standards.

At the moment we don't offer any API guarantees. API stability and documentation will happen after we are happy with how things are working within Home Assistant.

## FAQ

### Can i use this to make a homekit accessory?

No, this is just the client part. You should use one the of other implementations:

* [homekit_python](https://github.com/jlusiardi/homekit_python/)
* [HAP-python](https://github.com/ikalchev/HAP-python)


## Why don't you use library X instead?

At the time of writing this is the only python 3.7/3.8 asyncio HAP client.


## Thanks

This library wouldn't have been possible without homekit_python, a synchronous implementation of both the client and server parts of HAP.
73 changes: 73 additions & 0 deletions homekit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# Copyright 2019 aiohomekit team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

__all__ = [
"Controller",
"BluetoothAdapterError",
"AccessoryDisconnectedError",
"AccessoryNotFoundError",
"AlreadyPairedError",
"AuthenticationError",
"BackoffError",
"BusyError",
"CharacteristicPermissionError",
"ConfigLoadingError",
"ConfigSavingError",
"ConfigurationError",
"FormatError",
"HomeKitException",
"HttpException",
"IncorrectPairingIdError",
"InvalidAuthTagError",
"InvalidError",
"InvalidSignatureError",
"MaxPeersError",
"MaxTriesError",
"ProtocolError",
"RequestRejected",
"UnavailableError",
"UnknownError",
"UnpairedError",
]

from homekit.controller import Controller
from homekit.exceptions import (
BluetoothAdapterError,
AccessoryDisconnectedError,
AccessoryNotFoundError,
AlreadyPairedError,
AuthenticationError,
BackoffError,
BusyError,
CharacteristicPermissionError,
ConfigLoadingError,
ConfigSavingError,
ConfigurationError,
FormatError,
HomeKitException,
HttpException,
IncorrectPairingIdError,
InvalidAuthTagError,
InvalidError,
InvalidSignatureError,
MaxPeersError,
MaxTriesError,
ProtocolError,
RequestRejected,
UnavailableError,
UnknownError,
UnpairedError,
)
Loading

0 comments on commit ff9b712

Please sign in to comment.