Skip to main content

Async client for eGauge energy monitor (https://www.egauge.net)

Project description

Egauge-Async

asyncio APIs for communicating with eGauge meters.

Examples

Get current rates

import asyncio
from egauge_async import EgaugeClient

async def get_current_rates():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    current_readings = egauge.get_current_rates()
    print(current_readings)

asyncio.run(get_current_rates())

Get weekly changes over the last 4 weeks

import asyncio
from egauge_async import EgaugeClient

async def get_weekly_changes():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    weekly_changes = egauge.get_weekly_changes(num_weeks=4)
    print(weekly_changes)

asyncio.run(get_weekly_changes())

Get available registers

import asyncio
from egauge_async import EgaugeClient

async def get_registers():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    instantaneous_registers = egauge.get_instantaneous_registers()j
    print(instantaneous_registers)
    historical_registers = egauge.get_historical_registers()
    print(historical_registers)

asyncio.run(get_historical_registers())

Implementation Details

This package uses the publically-documented XML API provided by eGauge Systems. It also provides support for the newer JSON API with JWT authentication.

Testing

The project includes both unit tests and integration tests:

Running Tests

# Run all unit tests (default)
uv run pytest

# Run with coverage
uv run pytest --cov=egauge_async

# Run integration tests (requires real eGauge device)
export EGAUGE_URL="https://egauge12345.local"
export EGAUGE_USERNAME="owner"
export EGAUGE_PASSWORD="your_password"
uv run pytest -m integration

Integration tests validate functionality against a real eGauge device and are automatically skipped if the required environment variables (EGAUGE_URL, EGAUGE_USERNAME, EGAUGE_PASSWORD) are not set.

Disclaimer

This project is not affiliated with, endorsed by, or sponsored by eGauge Systems LLC. Any product names, logos, brands, or other trademarks are the property of their respective trademark holders.

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

egauge_async-0.2.0.tar.gz (121.3 kB view details)

Uploaded Source

Built Distribution

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

egauge_async-0.2.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file egauge_async-0.2.0.tar.gz.

File metadata

  • Download URL: egauge_async-0.2.0.tar.gz
  • Upload date:
  • Size: 121.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for egauge_async-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aa2f622efce9aac10150cb30e358bf04157fe6cd3286971410f454973e9e6b24
MD5 3f8beac64dbe2ca521454cdc573ef978
BLAKE2b-256 5f053fabbb420fd5b318d570832c578e8991182eec6c4875a88e4fd0c86b497c

See more details on using hashes here.

File details

Details for the file egauge_async-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for egauge_async-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9455d6c40c04763e1772d94c3744aeec050f99dd7e42409439b36ef304dd594f
MD5 d7b7928d0786b4dea0111c4dccae15ef
BLAKE2b-256 a3ce1ed2de794f67d7e52b07e40dae10c2f86e35f344eeddc76b7d072ab12831

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