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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e224f2f9c3da4b851610ec858400a6f6f6fac58275e53897c66f74b18f61989a |
|
MD5 | 5ec9cce719c46b12bb7c25dd3ad7b267 |
|
BLAKE2b-256 | ae6e14cd8cfbd3e434e8323350adca4279714a67d4ebca1c52be04cabd8d86e7 |
Close
Hashes for coolkit_client_phoenix-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 204a4fbb7a85f4f57305029678ac6009140f4199592a91a148554bf03a560600 |
|
MD5 | 2c254b809c65995cc5ffb6da06ee1ebb |
|
BLAKE2b-256 | d2264bb835ab566e7ed82065c54b9cfec86578c8fdb89dbc3b7ef2a47a0481dd |