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())
```
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
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
Built Distribution
Close
Hashes for coolkit-client-phoenix-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 625f71abbc1ba189ca07d7754cf04bd6a46446a1afec79eadc14cb4fb55aa182 |
|
MD5 | 418cd0bd13b3c868b953eb3e0e3d23d9 |
|
BLAKE2b-256 | 8d3f886648c9870cb2c1f0ccda6492089f054cd93867dd109e2fda288e295ee9 |
Close
Hashes for coolkit_client_phoenix-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f1510edd8e9b331f9b04d5932f3103935ba1606cc75a17fd8c64c3eac27a51 |
|
MD5 | 90d4533abfa7bd4a910592b8b2b8594d |
|
BLAKE2b-256 | c681ac95a0f6959631e10460be1eaceda5d18dc0637fe1bb87a40517986f28b5 |