Catalog PyPI
PACKAGE EXPLORERView in registry

aioaxlevpp

PyPI

Asynchronous client for Axle Energy Home Assistant grid events

Versions collected1
Direct dependencies1From release 0.2.0
Last observed21 Oct, 11:38 UTC

README

Version 0.2.0 documentation
aioaxlevpp wordmark with a grid event pulse

aioaxlevpp

An asynchronous, read-only Python client for Axle Energy Home Assistant grid events.

PyPI Python 3.13+ License: Apache 2.0

Install | Quick start | Response and errors | Scope | Development

aioaxlevpp reads the event exposed by Axle Energy's Home Assistant endpoint. It accepts a caller-owned aiohttp.ClientSession and an Axle Home Assistant token. The package does not enrol an account, control an inverter, opt in or out of an event, or dispatch a device.

Install

Python 3.13 or newer is required.

python -m pip install aioaxlevpp

Quick start

import asyncio
import os

from aiohttp import ClientSession
from aioaxlevpp import AxleClient


async def main() -> None:
    token = os.environ["AXLE_HOME_ASSISTANT_TOKEN"]
    async with ClientSession() as session:
        event = await AxleClient(session, token).get_event()

    if event is None:
        print("No event announced")
    else:
        print(event.direction, event.start, event.end)


asyncio.run(main())

To read the event and Axle's raw participation flag together, use get_status(). Its opted_out value is True or False when Axle returns a Boolean, and None when the field is absent. The provider documentation does not define whether this flag describes an account or a particular event, so the client preserves the value without interpreting it as consent. A malformed flag raises AxleError, including when the schedule is empty.

status = await AxleClient(session, token).get_status()
print(status.event, status.opted_out)

Get the token through Axle's Home Assistant setup. Keep it out of source code, logs, and issue reports. The client does not close the session; the caller owns its lifetime and polling schedule. Axle's published example polls every 600 seconds.

Response and errors

get_status() returns a frozen AxleStatus containing an optional frozen GridEvent and the optional raw Boolean opted_out flag. get_event() remains available and returns only the GridEvent (or None) from the same response. An event contains timezone-aware start, end, and updated_at values, a direction of import or export, and a Boolean opted_out field (defaulting to False when the raw flag is absent for compatibility). Both methods return no event for JSON null, an empty object, or an object whose start_time, end_time, and import_export fields are explicitly null. Malformed events or non-Boolean raw flags raise an error rather than being treated as no event.

ExceptionMeaning
AxleAuthenticationErrorThe endpoint returned HTTP 401 or 403. Check the token.
AxleConnectionErrorThe request failed or timed out.
AxleErrorThe endpoint returned another unsuccessful status or invalid event data.

The client applies a 10-second request timeout, rejects redirects, and omits credentials and response bodies from its own exception messages. It makes one read-only request per call.

Scope and security

This independent package implements only Axle's Home Assistant grid-event read path. It does not contain account, payment, opt-in, or equipment-control operations. The public Axle OpenAPI document does not currently describe this endpoint; the endpoint behaviour has been checked against a development account and covered by local tests. No code was copied from the unlicensed HACS repository. Treat the returned event as schedule data for the calling application, which remains responsible for its own decisions and timing.

Report reproducible problems through GitHub Issues. Do not include tokens or private account data. This project is independent of Axle Energy.

Development

From a checkout, run:

uv run pytest
uv run ruff check .
uv run mypy aioaxlevpp

The package is released under the Apache 2.0 licence.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.04 Oct 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
herbertmt978/python-axle

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:b03c8b4c9ba915b934e1df35b47ab6733cc71d8a6119dc63bcebb49b9446cc77