Skip to main content

cleware-traffic-light

License PyPI version

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

Metadata

Release files for cleware-traffic-light 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cleware-traffic-light 1.0.8
File Size Uploaded
cleware-traffic-light-1.0.8.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cleware-traffic-light 1.0.8
File Interpreter ABI Platform
cleware_traffic_light-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / cleware-traffic-light-1.0.8.tar.gz

Download URL cleware-traffic-light-1.0.8.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c2a614751d6687e676aa16c81468e7e4b5922c47a067760e31f3bfc7e539e264
BLAKE2b-256 checksum
How to use checksums
89ae3371a26c6349992247422a7f50b08842abe07d67c3989ac1e693784538be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / cleware_traffic_light-1.0.8-py3-none-any.whl

Download URL cleware_traffic_light-1.0.8-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b937b4f0ea9003490e212b3ca1b164b3595971f5fdc0498236a3e812b2e16106
BLAKE2b-256 checksum
How to use checksums
eca68c9203e1974912647e489bca9cb96bc20409d0fd6370edcde992ddc15019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page