Python3 modul and cli tool to controll the Cleware traffic light
Project description
cleware-traffic-light
cleware-traffic-light an easy to use CLI tool written in Python3 to control the cleware USB traffic light. It supports multiple traffic light control and the usage as a module in your own Python application.
Usage
Module
from traffic_light import ClewareTrafficLight, Color, State
ClewareTrafficLight().red_on()
ClewareTrafficLight().yellow_off()
# with address for specific light
ClewareTrafficLight(21).green_on()
CLI
ctl --red on
ctl -r on
ctl --red on --green off
ctl --red off --green on --address 19
Installation
use pip to install cleware-traffic-light
sudo pip3 install cleware-traffic-light
Linux
To use the CLI as a user you first have to create the USB rule
# go to directory
cd /etc/udev/rules.d/
# create file with the rule
vi 99-clewareampel.rules
Content
SUBSYSTEM=="usb", ATTR{idVendor}=="0d50", ATTR{idProduct}=="0008", MODE="666"
Help
usage: ctl [-h] [-r {on,off}] [-y {on,off}] [-g {on,off}]
[-a ADDRESS]
Turns the led of the cleware traffic light on or off
optional arguments:
-h, --help show this help message and exit
-r {on,off}, --red {on,off}
Controlls the red led
-y {on,off}, --yellow {on,off}
Controlls the yellow led
-g {on,off}, --green {on,off}
Controlls the green led
-a ADDRESS, --address ADDRESS
Specifies which traffic light should be used
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 cleware-traffic-light-1.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c7dc88c7d01bf8b8e3aa3cad7b013403ff5c2999c85c97b9b2666688a6a41e |
|
MD5 | 8e9a469596d7d683862eda0d3aebb7d6 |
|
BLAKE2b-256 | 05dccdebcb63cd02a41ddf7e942b2d27c6e35cad191cc4cbe89a243fe10aa431 |
Close
Hashes for cleware_traffic_light-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fead136f456e1179fd87836769c1bcd2da9741939a8a684893b3ee033dd15d4 |
|
MD5 | 9dc303d2a2e4d9c4611c9fe43cc13f01 |
|
BLAKE2b-256 | 723dbf480a6607f7e744db514357a79c029319d2e7c6d5ca28ec11452d4e8a40 |