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.3.0.tar.gz (123.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.3.0-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for egauge_async-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1a1915eff49cb937a5aaed243f6825479be9b3254697e65d633bcb2e4a9ac0bf
MD5 75f35c4bb7557b3e6594bfe57143c305
BLAKE2b-256 39ea76d4225f4d7e02c53cd70935e21a3fe4094df7cdd1188624da78dac7edd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for egauge_async-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1cdf9318cc3ecf00d79ab9d24c0aafd328ccd72817bcbaec23e4c925adcab0
MD5 0468961aa387368bc3a3d8abc109261f
BLAKE2b-256 836e5447be0b2b5c59a5108ab420f3636b36fa7f6b9d4c9a8ceeb3cd031d4c91

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