Skip to main content

Async client for INELNET blinds controller REST API (one object per channel).

Project description

inelnet-api

Async client library for the INELNET blinds controller REST API. One object represents one channel (host + channel number).

Installation

pip install inelnet-api

Usage

Create one InelnetChannel instance per channel (host + positive channel number):

import asyncio
from inelnet_api import Action, InelnetChannel

async def main():
    channel = InelnetChannel(host="192.168.1.67", channel=1)

    # Check controller availability
    ok = await channel.ping()
    if not ok:
        print("Controller unavailable")
        return

    # Move: open / close / stop
    await channel.up()
    await channel.down()
    await channel.stop()

    # Short move and programming mode
    await channel.up_short()
    await channel.down_short()
    await channel.program()

    # Optional: custom session (e.g. from Home Assistant)
    # await channel.send_command(Action.UP_SHORT, session=hass_session)
    # await channel.up(session=hass_session)

asyncio.run(main())

API

  • InelnetChannel(host: str, channel: int) – channel must be >= 1.
  • send_command(act, *, session=None, timeout=...) – send a command; act is an Action enum member (e.g. Action.UP, Action.DOWN, Action.STOP) or an integer.
  • ping(*, session=None, timeout=...) – GET to the controller, returns True if reachable.
  • up(), down(), stop(), up_short(), down_short(), program() – convenience methods (optional session=).

If you do not pass session, the library creates a temporary aiohttp.ClientSession() per call. In environments like Home Assistant you can pass async_get_clientsession(hass) for a shared HTTP client session.

Publishing to PyPI (for maintainers)

# One-time
pip install build twine

# Build
python3 -m build

# Upload to PyPI (requires account and token)
twine upload dist/*
# or test PyPI only:
twine upload --repository testpypi dist/*

After code changes, update version in pyproject.toml and inelnet_api/__init__.py, then run python3 -m build and twine upload dist/* again. Versions published on PyPI should match tagged releases (e.g. tag v1.0.0 for version 1.0.0).

Development / Testing with Home Assistant

To try the library inside Home Assistant before publishing to PyPI (e.g. from the same repo):

  1. In your Home Assistant dev environment, activate the virtual environment and install the library in editable mode:

    pip3 install -e /path/to/ha_inelnet
    
  2. Run Home Assistant without installing the package from PyPI (so your local code is used):

    hass --skip-pip-packages inelnet_api
    

See Building a Python library for an API for more.

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

inelnet_api-1.0.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

inelnet_api-1.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file inelnet_api-1.0.1.tar.gz.

File metadata

  • Download URL: inelnet_api-1.0.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for inelnet_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 16e279eb35cf46975b8d3f7002b593fb2f7181ac0f04eff27d7d7fe8cf13b9ea
MD5 9faffbd51a347af557543e217de62138
BLAKE2b-256 2fd39cba049c8448fca184b58ea81937b2b59f36a230247abaea0c95f18ebff7

See more details on using hashes here.

File details

Details for the file inelnet_api-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: inelnet_api-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for inelnet_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb21581fdfa2eb92fad0a7648eb0d1ba885de653703e04020f55217f5d0125c
MD5 2100ae4d9c152ba3aa6e1752682ecde0
BLAKE2b-256 cd4c9cc629aefd3b792e5363cee0cfe37b332a6d73319be3808eeb5fe85e8745

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