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

API

See the API doc.

Developing

To get setup for development, run

$ pdm run init

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

$ pdm run 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.6.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

hubitatmaker-0.6.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hubitatmaker-0.6.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for hubitatmaker-0.6.1.tar.gz
Algorithm Hash digest
SHA256 28740a1e718f25585825eeac9a75aed4753223f4d9490cbc4d661bfba7051836
MD5 4ed7674de1f0bbcd4ce701751a26ed43
BLAKE2b-256 50c7155030fdad8f6bbc7b49054289db0569342b3ecce118eac39a1520941fc5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hubitatmaker-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for hubitatmaker-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 726f7a33c2281cc1847f009023ace70ad4d0801abd75aa089b84fab0d86e0992
MD5 26657367c8ce29d8e712b4645d8dca03
BLAKE2b-256 e80776be33c94db34cb38c3d2e309de0be65cce90a76a3e5dfb65bd59d4d6271

See more details on using hashes here.

Supported by

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