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.0rc3.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.0rc3-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: egauge_async-0.2.0rc3.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.0rc3.tar.gz
Algorithm Hash digest
SHA256 4028455b0aa400e3a826f970ab4c656621b3b3bb0507373ddc71d4c8f811908c
MD5 92921e062e767230c2c72a5ccd64ddfe
BLAKE2b-256 f588156afeb6712956ebb5f53f2efc2935f3bf582d03cfe29ca35d0c8e9ce778

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for egauge_async-0.2.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 952870c20b3b6d747576b5b4edeccc2a2f3b4128f717f4e6796c3437c3b48420
MD5 95276944392523ad14e091734e5bf7ed
BLAKE2b-256 8f9a5bcca51c4f16720026d2df1244fc5725bc728aaa55b8b21d039b354dfe00

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