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_HOST="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_HOST, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file egauge_async-0.4.0.tar.gz.
File metadata
- Download URL: egauge_async-0.4.0.tar.gz
- Upload date:
- Size: 125.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37a2dccec44b66a81b42681da5c57cf0df01ad8f17db82ce449a07bce22026bf
|
|
| MD5 |
d9d3aa0ba05c03773fba25336160b171
|
|
| BLAKE2b-256 |
33f65eee843ecfc74a24b8b58fde89e4629a3e65496c5adfb5645a73fadbd54a
|
File details
Details for the file egauge_async-0.4.0-py3-none-any.whl.
File metadata
- Download URL: egauge_async-0.4.0-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ad17739bb2a956f83aa5532afd879d8f9073b279e2543184f64696953d3031b
|
|
| MD5 |
f8aa6a6a67979500f1de91b30bceabbd
|
|
| BLAKE2b-256 |
b6f82602d27c0c1400fdbba77930857aee4a32099724c90108d9fa69a86861c7
|