Async client for INELNET blinds controller REST API (one object per channel).
Project description
inelnet-api
Asynchrónny klientsky balík pre REST API ovládača INELNET rolet. Jeden objekt reprezentuje jeden kanál (host + číslo kanála).
Inštalácia
pip install inelnet-api
Použitie
Pre každý kanál vytvor jednu inštanciu InelnetChannel (host + číslo kanála 1–16):
import asyncio
from inelnet_api import Action, InelnetChannel
async def main():
channel = InelnetChannel(host="192.168.1.67", channel=1)
# Kontrola dostupnosti
ok = await channel.ping()
if not ok:
print("Kontrolér nedostupný")
return
# Pohyb: otvoriť / zatvoriť / stop
await channel.up()
await channel.down()
await channel.stop()
# Krátky posun a programovací režim
await channel.up_short()
await channel.down_short()
await channel.program()
# Príkaz podľa enumu (Action.UP, Action.DOWN, Action.STOP, …)
# await channel.send_command(Action.UP_SHORT, session=hass_session)
# Voliteľne: vlastná session (napr. z Home Assistant)
# await channel.up(session=hass_session)
asyncio.run(main())
API
InelnetChannel(host: str, channel: int)– kanál musí byť 1–16.send_command(act, *, session=None, timeout=...)– odoslanie príkazu;actje člen enumuAction(napr.Action.UP,Action.DOWN,Action.STOP) alebo celé číslo.ping(*, session=None, timeout=...)– GET na kontrolér, vrátiTrueak je dostupný.up(),down(),stop(),up_short(),down_short(),program()– pohodlné metódy (voliteľnesession=).
Ak nepredáš session, knižnica pre každý volanie dočasne vytvorí vlastnú aiohttp.ClientSession(). V prostredí ako Home Assistant môžeš predať async_get_clientsession(hass) kvôli zdieľanému HTTP klientskému session.
Publikovanie na PyPI (pre maintainera)
# Jednorazovo
pip install build twine
# Build
python3 -m build
# Nahratie na PyPI (vyžaduje účet a token)
twine upload dist/*
# alebo len test PyPI:
twine upload --repository testpypi dist/*
Po úprave kódu zmeň version v pyproject.toml a v inelnet_api/__init__.py, potom znova python3 -m build a twine upload dist/*.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inelnet_api-1.0.0.tar.gz.
File metadata
- Download URL: inelnet_api-1.0.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c3e3cd60c3595c2f357193c9e6eb9051eadaa67e74258b687ac657acbc0f469
|
|
| MD5 |
e2c8ced83c139f6ea28235702260dec2
|
|
| BLAKE2b-256 |
641f845503938931e5b59188ca7dd30f3f5cf0788a0c94325817f4cc6ee65a30
|
File details
Details for the file inelnet_api-1.0.0-py3-none-any.whl.
File metadata
- Download URL: inelnet_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6686b5cc596500c0bd9e8e064c49546977f18859ba7c2e266dc025c3fecc42f3
|
|
| MD5 |
c8cdae79a307ff14bda926d82184e324
|
|
| BLAKE2b-256 |
b1c0c1571dcd63a573727006389fff082bfd52047410bddecf7fc6eb12443cc6
|