Skip to content

Commit

Permalink
Finish implementing 0.1
Browse files Browse the repository at this point in the history
This commit includes functional device and discovery modules based on
the prior prototype. The prototype is reworked as a proper package
command and retains its more advanced functionality.

This commit also switches to poetry because it's just nicer than
setuptools.
  • Loading branch information
jfroy committed May 4, 2022
1 parent 84e1812 commit 158e8dc
Show file tree
Hide file tree
Showing 15 changed files with 1,142 additions and 405 deletions.
171 changes: 5 additions & 166 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,168 +1,7 @@
# https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
/.venv/
/.vscode/
/dist/
/dumps/
/poetry.lock

# Dumps
/dumps

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Visual Studio Code
/.vscode
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
# Big Ass Fans i6

## Keep-alive
aiobafi6 is a python library to discovery, query and control
[Big Ass Fans](https://bigassfans.com) products that use the i6 protocol, which
includes i6 fans and Haiku fans with the 3.0 firmware.

On client start, send `root { root2 { keep_alive {} } }`. That will trigger a
full query update from the device. And after that, send
`root { root2 { keep_alive { 1: 3 } } }` every 15 seconds.
It supports almost all the features of the previous protocol ("SenseMe"), with
the exception of presence sensing, rooms, and sleep mode.

## Compiling the aiobafi6 protocol buffer

The BAF i6 protocol uses
[protocol buffers](https://developers.google.com/protocol-buffers) for message
wire serialization. This library maintains a
[single proto file](proto/aiobafi6.proto) with all known messages and contants.

The generated Python client for this proto file is checked in the repo to avoid
depending on the protocol buffer compiler for installation. Whenever the source
proto file is changed, the Python client files must be re-generated.

`poe protoc`
11 changes: 7 additions & 4 deletions aiobafi6/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""aiobafi6"""

from .discovery import Service, make_service_browser
from .device import Device, OffOnAuto
from .discovery import Service, ServiceBrowser

__all__ = [
__all__ = (
"Device",
"OffOnAuto",
"Service",
"make_service_browser",
]
"ServiceBrowser",
)
Empty file added aiobafi6/cmd/__init__.py
Empty file.
Loading

0 comments on commit 158e8dc

Please sign in to comment.