Skip to main content

A python 3 API wrapper for GL-inet routers for consumption by Home Assistant

Project description

gli4py

A aysnc python 3 API wrapper for GL-inet routers with version 4 firmware. [WIP]

GL-inet routers are built on OpenWRT. They are highly customizeable but have an attractive user interface.

As part of their modiification of the UI they used to provide a documented locally accessible API.

I thought it would be handy to develop a python 3 wrapper for the API for easy intergation into other services such as HomeAssistant

Installation

pip3 install gli-py

Dev setup

  1. Clone the repo
  2. Ensure you have python 3.11 or greater installed python3 -V or python -V
  3. Uses poetry for venv control pip3 install poetry
  4. poetry config virtualenvs.in-project true create the venvs in the project folder
  5. poetry install
  6. poetry env activate
  7. To run tests, ensure there is a file called router_pwd in the root directory with the router password in.
  8. Then run pytest -s to see responses, assumes the router is at 192.168.0.1
  9. Set token with poetry config pypi-token.pypi TOKEN
  10. publish with poetry publish --build

Dev setup alongside HA & the Custom component

  1. Clone the repo into the vscode /workspaces/ dir
  2. The inside the ha-env terminal run (ha-venv) vscode ➜ /workspaces/core (branch-name) $ pip install -e /workspaces/gli4py
  3. Ensure the custom component has "python.analysis.extraPaths": ["/workspaces/gli4py/"] in .vscode/settings.json
  4. deactivate the ha-env with deactivate
  5. Do steps 3 onwards above

Todo list:

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

gli4py-0.0.16.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

gli4py-0.0.16-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file gli4py-0.0.16.tar.gz.

File metadata

  • Download URL: gli4py-0.0.16.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gli4py-0.0.16.tar.gz
Algorithm Hash digest
SHA256 a23f539a0fddb27eaf1bf8c2b04ef28ac89e3d15952947ffd764e804e11525ff
MD5 7226229383c1cba8e06e150e9d0119ca
BLAKE2b-256 36f9de26129050c55d27ab5b1aaaf32e7210cee52a545ac1a198fc38f371102b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gli4py-0.0.16.tar.gz:

Publisher: python-publish.yml on HarvsG/gli4py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gli4py-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: gli4py-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gli4py-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b67f83c94d7998e904876a4a9aa31e86ae18a48c7f8c5894a36434d200e27be4
MD5 31074181384c1ce2540edbdbc2a12324
BLAKE2b-256 74eb61baff882d7b29c7044675f51112583c0920620889cf0ad0fb9acd98007e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gli4py-0.0.16-py3-none-any.whl:

Publisher: python-publish.yml on HarvsG/gli4py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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