Python client for Open Surplus Manager
Project description
pyOSManager
Python client for Open Surplus Manager
Installation
pip install pyosmanager
Usage
import asyncio
from pyosmanager import OSMClient
async def main():
async with OSMClient("http://localhost:8080") as client:
print(await client.get_devices())
if __name__ == "__main__":
asyncio.run(main())
Methods
is_healthy() -> bool
True if the server is healthy
get_devices() -> list[DeviceResponse]
Retrieve a list of devices
get_device(device_name: str) -> DeviceResponse
Retrieve a device data dictionary by name
get_device_consumption(device_name: str) -> float
Retrieve the device consumption by name
get_surplus() -> float:
Retrieve the surplus value
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
pyosmanager-0.1.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for pyosmanager-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f1586277bc7b57f1dfd745f54ad191e72775d3b925fec7a3a1fea633fdc4a2 |
|
MD5 | 1b3c08c645c95dc6c5d08b8d82ed6eca |
|
BLAKE2b-256 | 3b518660f4ca70cd24ae69cbbff560f76ddec4559ba5efcd7d0c9747d17625f1 |