GithubHelp home page GithubHelp logo

thesola10 / whlctl Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 10 KB

WartHog Lights ConTroL

Home Page: https://pypi.org/project/whlctl/

License: Other

Python 100.00%
linux-gaming thrustmaster-warthog-hotas usb-hid

whlctl's Introduction

Warthog Lights Control

This Python module and command line tool control the lights on Thrustmaster's Warthog HOTAS throttle box.

Largely based on the reverse-engineering work done by mfranz

How to use

Once installed, this tool provides a Python module and a command-line tool, both named whlctl.

Command line tool

whlctl 0        # Turn off backlight
whlctl 5        # Turn backlight up to max brightness
whlctl 3 -l 1,5 # Turn lights 1 and 5 up to brightness 3/5
whlctl 1 -l 0,5 # Turn backlight and light 5 up to brightness 1/5

Omitting the -l flag will default to adjusting the backlight, and turn off all other lights.

Python API

import whlctl

whlctl.find_throttle()  # -> "/dev/hidrawN" or FileNotFoundError
whlctl.write_leds(backlight=True, leds=[True,True,True,True,True], brightness=5)
                        # -> None or FileNotFoundError (see find_throttle)

find_throttle()

Takes no argument and returns the HID node for the Thrustmaster Warthog throttle (044f:0404), or raises a FileNotFoundError if the device isn't found.
This function is cached.

write_leds(backlight: bool, leds: list[bool], brightness: int)

The leds list must contain 5 booleans which designate, in order, the five circular lights from top to bottom. True means the light is to be powered on at the given brightness, False means it should be powered off.
brightness is expressed between 0 and 5.
Returns nothing, implicitly calls find_throttle() and thus can fail with FileNotFoundError as above. It can also hit a permission error if the current user has no write permission to the device node.

whlctl's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.