File: README.md

package info (click to toggle)
pyevilgenius 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 128 kB
  • sloc: python: 90; makefile: 7
file content (54 lines) | stat: -rw-r--r-- 1,039 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# pyevilgenius

## Asynchronous library to control devices by Evil Genius Labs

Requires Python 3.8+ and uses asyncio and aiohttp.

```python
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

```bash
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:

```python
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.