Skip to main content

Python module to talk to Rainforest EAGLE-200.

Project description

Aioeagle

Asynchronous library to control Rainforest EAGLE-200

Requires Python 3.8+ and uses asyncio and aiohttp.

import asyncio
from pprint import pprint

import aiohttp
from aioeagle import EagleHub


CLOUD_ID = "123456"
INSTALL_CODE = "abcdefghijklmn"


async def main():
    async with aiohttp.ClientSession() as session:
        await run(session)


async def run(websession):
    hub = EagleHub(websession, CLOUD_ID, INSTALL_CODE)
    devices = await hub.get_device_list()

    if len(devices) == 0:
        print("No devices found")
        return

    device = devices[0]

    pprint(device.details)
    print()
    pprint(await device.get_device_query(device.ENERGY_AND_POWER_VARIABLES))


asyncio.run(main())

Testing locally

python3 example.py <cloud_id> <install_code>

Timeouts

Aioeagle does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend the async_timeout package:

import async_timeout

with async_timeout.timeout(10):
    devices = await hub.get_device_list()

Contribution guidelines

Object hierarchy and property/method names should match the EAGLE-200 API.

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

aioeagle-1.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

aioeagle-1.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file aioeagle-1.1.0.tar.gz.

File metadata

  • Download URL: aioeagle-1.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for aioeagle-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cd56c8d51b731633105cf6194dffeb689d88878139db20cb1f6f2e41b6a1a753
MD5 6fd9cfcc52cd2a139b4198802b7a0177
BLAKE2b-256 40f580548f947411d8bbcdf53ff44300659c30897cd87a620e00e0919945d81a

See more details on using hashes here.

File details

Details for the file aioeagle-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: aioeagle-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for aioeagle-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a72798d40e278de4958e941a28de4b0405352c23577696d7e33d5b80db119d58
MD5 70696e8a0b89d653d30fda38330f96bc
BLAKE2b-256 07b6277d62e489a945d508c98f6f300f47c0950a327bf5cfca51cc64e20aea48

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page