Skip to main content

Control pwrusb.com power strip outlets

Project description

# pwrusb

A python wrapper for controlling pwrusb.com power strip outlets.

## Installation notes

To avoid copyright issues, several files are not included in this distribution. Makefile will attempt to download and install these files automatically. Or, they can be downloaded from the Mac software distribution from the [pwrusb website](http://www.pwrusb.com/downloads.html). These files are:

PwrUSBImp.h
PwrUsbCmd.cpp
libpowerusb.dylib

A version of libusb-1.0 will need to be installed. One straightforward way to get this is via [homebrew](http://brew.sh/) with:

brew install libusb

The `swig` package also needs to be installed in your python distribution for pwrusb to work.

## Usage

Example usage:

import pwrusb
bank = 0
for outlet in [1, 2, 3]:
print "outlet {} is {}".format(outlet, pwrusb.get_single_outlet_state(bank, outlet))
pwrusb.set_single_outlet_state(bank, 2, True)
for outlet in [1, 2, 3]:
print "outlet {} is {}".format(outlet, pwrusb.get_single_outlet_state(bank, outlet))
for outlet in [1, 2, 3]:
pwrusb.set_single_outlet_state(bank, outlet, False)

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

pwrusb-0.2.0.tar.gz (4.0 kB view hashes)

Uploaded Source

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