Integration Helper

raw JSON →
0.2.2 verified Fri May 01 auth: no python

A lightweight set of helper utilities for Python integrations, commonly used in Home Assistant custom components. Current version is 0.2.2. Low release cadence.

pip install integrationhelper
error ModuleNotFoundError: No module named 'integrationhelper'
cause Library not installed in the Python environment.
fix
Run 'pip install integrationhelper' in the correct environment.
error ImportError: cannot import name 'XYZ' from 'integrationhelper'
cause Trying to import a symbol that does not exist in the library (e.g., a typo or outdated version).
fix
Check the official documentation or source for correct available imports. Use 'from integrationhelper import IntegrationLogger' for common helpers.
gotcha Throttle uses wall-clock time, not async; may block event loop if used in async context.
fix Use async-compatible throttling or run in executor.
gotcha IntegrationLogger is a simple wrapper around Python logging; does not support advanced formatting like Home Assistant's custom component logger.
fix For advanced logging, consider using Home Assistant's homeassistant.helpers.logging or structlog.

Basic usage of IntegrationLogger and Throttle decorator.

from integrationhelper import IntegrationLogger, Throttle
import logging

logger = IntegrationLogger(__name__)
logger.info("Integration helper works!")

@Throttle(min_time=10)
def my_throttled_function():
    return "Called once per 10 seconds"

print(my_throttled_function())