Skip to main content

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 determine the Hubitat hub's MAC address and and download 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. Each Hub instance starts a new event listener server to receive events from the hub, and updates the Maker API instance with an accessible URL for this listener server.

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))

Developing

To get setup for development, run

$ ./dev init

To test the code, which will type check it and run unit tests, run

$ ./dev test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hubitatmaker-0.3.5.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hubitatmaker-0.3.5-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file hubitatmaker-0.3.5.tar.gz.

File metadata

  • Download URL: hubitatmaker-0.3.5.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for hubitatmaker-0.3.5.tar.gz
Algorithm Hash digest
SHA256 56411bd5094dc7d21fa77d5d1594992aefcef3a98e03702c2a163772b19f8bb7
MD5 68d015c39936eadf6987389e16e8a66d
BLAKE2b-256 48a7f9fe80ee98d257ecf94af5babded4fd8a3c8305e29db18a535871bb7c6e9

See more details on using hashes here.

File details

Details for the file hubitatmaker-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: hubitatmaker-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for hubitatmaker-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b14573e0b8962174bf5c70fb6aa6a7630489571b6aa365f6942148a9bb2d961
MD5 99b8fad701f1966cec1724f3f8f052b9
BLAKE2b-256 bb6b6c830eaebbb3187d80e578b833f903958e95720e0946c57cab842921cfae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page