Python module to talk to Evil Genius Labs devices.
Project description
pyevilgenius
Asynchronous library to control devices by Evil Genius Labs
Requires Python 3.8+ and uses asyncio and aiohttp.
import asyncio
from pprint import pprint
import aiohttp
from pyevilgenius import EvilGeniusDevice
HOST = "192.168.1.113"
async def main():
async with aiohttp.ClientSession() as session:
await run(session)
async def run(websession):
device = pyevilgenius.EvilGeniusDevice(host, websession)
data = await client.get_data()
pprint(device.details)
await device.set_path_value('power', '1')
asyncio.run(main())
Testing locally
python3 example.py <host>
Timeouts
Pyevilgenius 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 Evil Genius Device APIs.
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
pyevilgenius-1.0.0.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for pyevilgenius-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e42717b60427e1197e0b8b485a7f47cf5c57c466afe7770cdb475e3d59d6f999 |
|
MD5 | e93e3d31031c0d3d0d6649238a5f51ad |
|
BLAKE2b-256 | 128bc65c607f9c4426d025073bf9f79fb9a9ed419eb862a0482ddeb41a4c1f20 |