A library for interfacing with Hubitat via its Maker API
Project description
hubitatmaker
This library provides an async Python interface for Hubitat Elevation’s Maker API. It is primarily intended for use with Home Assistant.
Features
The main public API in hubitatmaker is the Hub class. This class represents a Maker API instance on a Hubitat hub. When started, a Hub instance will download some basic information from the Hubitat hub, as well as a list of available devices and details about each device.
The Hub instance caches state information about each device. It relies on events
posted from the Hubitat hub to update its internal state. When used in a Home
Assistant integration, the assumption is that a webhook will be used to receive
the events, and the integration will pass them to a Hub instance via
process_event
. However, Hub can also start a standalone event receiver.
Basic usage
import asyncio
from hubitatmaker import Hub
async def print_devices(host, app_id, token):
hub = Hub(host, app_id, token)
await hub.start()
for device in hub.devices:
print(f"{device.name} ({device.id})")
if __name__ == '__main__':
host = 'http://10.0.1.99'
app_id = '1234'
token = '<apitoken>'
asyncio.run(print_devices(host, app_id, token))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hubitatmaker-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d883370c9381d52a4701a028dd870553a56a6fb5422892cbc488aa0f9f568922 |
|
MD5 | ae561948ee97e14dbe127c88fd889724 |
|
BLAKE2b-256 | 405c994ec2e0ab2d4647c447d79ac9e6966a36f108083ac05e92de7dc030a621 |