Skip to main content

Sonoff control library through coolkit/ewelink cloud

Project description

# ewelink-sonoff-coolkit-client
Client for Sonoff devices using eWeLink access

Inspired by https://github.com/peterbuga/HASS-sonoff-ewelink

## Usage example
```
#!/usr/bin/env python
import asyncio

from coolkit_client import CoolkitSession, CoolkitDevicesRepository
from coolkit_client.device_control import CoolkitDeviceControl
from coolkit_client.discover import CoolkitDevicesDiscovery


async def start():
await CoolkitSession.login(
username='my@email.com',
password='IDoNotTellYou!',
region='eu'
)

await CoolkitDevicesRepository.get_device('1000012345').switches[0].state(True)
await asyncio.sleep(1)
await CoolkitDevicesRepository.get_device('1000012345').switches[0].state(False)

await CoolkitDevicesDiscovery.discover()
CoolkitDeviceControl.start_daemon()

while True:
await asyncio.sleep(3600)

if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(start())

```


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

coolkit-client-phoenix-1.0.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

coolkit_client_phoenix-1.0.1-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

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