Skip to main content

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 )


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

vesync-outlet-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

vesync_outlet-0.1.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file vesync-outlet-0.1.0.tar.gz.

File metadata

  • Download URL: vesync-outlet-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for vesync-outlet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fc4d2b2fac8f79a420e07086a4559ea963adda23c1a75fa85e2c18594257c09
MD5 d300a0ae982f46fa4fabbac8010d3a81
BLAKE2b-256 c5b600f551c323256c8fe2770228d255cd0cde9c33c7ceaa272aee403c0d52d9

See more details on using hashes here.

File details

Details for the file vesync_outlet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vesync_outlet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for vesync_outlet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61f589ffdceb6c1bd8da9bd0b8816b80eeda3a22e43e121b88d8e3d61c82af83
MD5 2d501c189392bf4438577abce471f2b1
BLAKE2b-256 45aa389495e04dabb26a6cee4ad66f9487f2120463c33ea4b09bbd9eadd2f84a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page