pybhyve
is a Python3, asyncio-driven library that interfaces with both the
REST and Websocket APIs provided by Orbit BHyve.
pybhyve
is an unofficial API and is not endorsed by or supported by Orbit. The API
is not publicly documented and this library has been reverse engineered. As such,
there are no guarantees that it will continue to work.
If this code has been useful to you, please consider chipping in and buying me a coffee!
Many thanks to @bachya for laying most of the groundwork with bachya/aioambient.
pip install pybhyve
pybhyve
is currently supported on:
- Python 3.6
- Python 3.7
- Python 3.8
import asyncio
from aiohttp import ClientSession
from pybhyve import Client
async def async_websocket_handler(data):
_LOGGER.info("Websocket data: %s", data)
async def main() -> None:
"""Create the aiohttp session and run the example."""
async with ClientSession() as session:
client = Client("<YOUR USERNAME>", "<YOUR PASSWORD>", asyncio.get_event_loop(), session, async_websocket_handler)
await client.login()
# Get all devices in an account:
devices = await client.devices
_LOGGER.info("Devices: %s", devices)
asyncio.get_event_loop().run_until_complete(main())
- Check for open features/bugs or initiate a discussion on one.
- Fork the repository.
- Install the dev environment:
make init
. - Enter the virtual environment:
source ./venv/bin/activate
- Code your new feature or bug fix.
- Write a test that covers your new functionality.
- Run tests and ensure 100% code coverage:
make coverage
- Update
README.md
with any new documentation. - Add yourself to
AUTHORS.md
. - Submit a pull request!