sainsmart contains code for working with sainsmart products.
Project description
sainsmart
sainsmart contains code for working with sainsmart products.
Usage
To use EthernetRelay in a project:
import sainsmart relay = sainsmart.EthernetRelay() # Access the state of the relays # relay.state() is a list of bools relay_state = relay.state() # Turn on the relay at index 0. relay.turn_on(0) # Turn off the relay at index 0. relay.turn_off(0) # Toggle the state of relay 0. relay.toggle(0) # Turn on all relays. relay.all_on() # Turn off all relays. relay.all_off()
The SainSmart Ethernet Relay defaults ip address: 192.168.1.4/30000. This can be changed through their web interface.
To use EthernetRelay with a different IP address:
import sainsmart relay = sainsmart.EthernetRelay('http://192.168.44.100/30000')
Free software: MIT license
Documentation: https://sainsmart.readthedocs.io.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2017-06-12)
First release on PyPI.
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
sainsmart-0.1.0.tar.gz
(20.2 kB
view hashes)
Built Distribution
Close
Hashes for sainsmart-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1427ee17b5d950fbfd97fd4b531de815b2fbfc5f3bd9fb9b28a734d3847dc221 |
|
MD5 | e9f994bb3af1581a5b0b9fd9befd36b8 |
|
BLAKE2b-256 | 89e3ce4d8bd20b14c181895150acd291092f08e29166e062ff6e5b41da2f18f3 |