vesync-outlet is a library to control Vesync wifi outlets
Project description
# vesync-outlet
Python module to control Vesync WiFi power outlets
## Installation
```
pip3 install vesync-outlet
```
## Usage
```
from vesync_outlet import Vesync
hashpw = hashlib.md5(password.encode('utf-8')).hexdigest()
vesync = Vesync(username, hashpw)
devices, response = vesync.get_outlets()
for d in devices:
data, response = vesync.turn_on(d['id'])
data, response = vesync.turn_off(d['id'])
```
## Methods
The methods below return a tuple. The first element is the payload data.
If this entry is None, check results in the response object for errors.
### get_devices()
Get all wifi-switch outlet devices from Vesync api.
Arguments: none
Returns: ( payload, requests.response )
### turn_off(id)
Switch an outlet to OFF.
Arguments: the device ID
Returns: ( payload, requests.response )
### turn_on(id)
Switch an outlet to ON.
Arguments: the device ID
Returns: ( payload, requests.response )
Python module to control Vesync WiFi power outlets
## Installation
```
pip3 install vesync-outlet
```
## Usage
```
from vesync_outlet import Vesync
hashpw = hashlib.md5(password.encode('utf-8')).hexdigest()
vesync = Vesync(username, hashpw)
devices, response = vesync.get_outlets()
for d in devices:
data, response = vesync.turn_on(d['id'])
data, response = vesync.turn_off(d['id'])
```
## Methods
The methods below return a tuple. The first element is the payload data.
If this entry is None, check results in the response object for errors.
### get_devices()
Get all wifi-switch outlet devices from Vesync api.
Arguments: none
Returns: ( payload, requests.response )
### turn_off(id)
Switch an outlet to OFF.
Arguments: the device ID
Returns: ( payload, requests.response )
### turn_on(id)
Switch an outlet to ON.
Arguments: the device ID
Returns: ( payload, requests.response )
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
vesync-outlet-0.1.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for vesync_outlet-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a92d01dea5148d2e07bf1867ce625aea0638ba477302ac95c5bbd73323aa91c |
|
MD5 | dda12c43918613903c254965ae05fca2 |
|
BLAKE2b-256 | a1f3101b19a568a0890c024ccb8ab4c2bb5e7ca393a63d252339bd19c4280230 |