mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
7c15452c1e
## Link to GitHub Issue, if one exists #41 (partially) ## Description of change This PR adds support for outputting IIDX tape LED data via spiceapi (`iidx_tapeled_get()`). It returns the data as a `dict`, with the key being the LED name and the value being the list of RGB values. You can optionally pass in a variadic list of names to filter the returned data. The new API function is only implemented in Python since I'm not able to test the wrappers in other languages. An example script using the new API is available in this Beef Board PR: https://github.com/HWXLR8/beef-board/pull/133. Demo use case: https://streamable.com/pq5e1e ## Testing Tested in IIDX 32 with custom Beef Board firmware along with a Python script to read and send the tape LED data over USB.
29 lines
644 B
Python
29 lines
644 B
Python
from .connection import Connection
|
|
from .request import Request
|
|
|
|
|
|
def iidx_ticker_get(con: Connection):
|
|
res = con.request(Request("iidx", "ticker_get"))
|
|
return res.get_data()
|
|
|
|
|
|
def iidx_ticker_set(con: Connection, text: str):
|
|
req = Request("iidx", "ticker_set")
|
|
req.add_param(text)
|
|
con.request(req)
|
|
|
|
|
|
def iidx_ticker_reset(con: Connection):
|
|
req = Request("iidx", "ticker_reset")
|
|
con.request(req)
|
|
|
|
|
|
def iidx_tapeled_get(con: Connection, *light_names):
|
|
req = Request("iidx", "tapeled_get")
|
|
|
|
for light_name in light_names:
|
|
req.add_param(light_name)
|
|
|
|
res = con.request(req)
|
|
return res.get_data()
|