gri-gus / streamdeck-python-sdk Goto Github PK
View Code? Open in Web Editor NEWLibrary for creating Stream Deck plugins in Python.
License: Apache License 2.0
Library for creating Stream Deck plugins in Python.
License: Apache License 2.0
The plug-in I am writing makes long running socket connections to other services. These connections need to be read from and written to inorder to maintain the state needed by the plug-in. The existing StreamDeck.run() method requies the use of the websocket run_forever() method and does not provide access to its event loop or for selecting from other socket connections. It would be helpful if either the event loop was exposed or if the StreamDeck class could use an externally provided event loop.
A quick fix can be employed by the StreamDeck user with a simple modification. The idea is to import the rel module and pass its dispatcher to the StreamDeck.run() method. The websocket examples show how this works.
Here's some plug-in code assuming the modifications have been made.
import rel
...
StreamDeck(
actions=[
SetKeyImage(),
],
).run(dispatcher=rel)
rel.signal(2, rel.abort) # Keyboard Interrupt
rel.dispatch()
then in sdk.py two changes are needed, the first is for the run() method to accept the dispatcher parameter and the second is for it to make use of it
self.ws.run_forever(dispatcher=dispatcher)
This is a very simple change based on some older technology that has largely been replaced by asyncio. An asyncio solution could be "better", but just two lines and no breakage is hard to beat.
Pydantic validation fails when InfoColors.disabledColor
and InfoColors.mouseDownColor
are not sent by the streamdeck software.
PR to follow
Thanks much for all the hard work.
I’m a Python guy with very little JavaScript experience trying to figure out the JavaScript side of writing a plug-in. The lorumflickr example was a great help, but it doesn’t show any global settings usage. I’m pretty sure I’m setting them properly on the Python side, the values show up in the events in the log. But, I can’t figure out how to access them from the JavaScript in property inspector .html.
Care to point me in the right direction?
Hi,
currently i am stuck on set_title(). Would be nice if someone could assist :)
Goal is to do some Information output (a word) on a dedicated Button, aka change the title.
In my plugin there is some calculation ongoing in a thread function and i want to change a button during the calculation.
def myfunction():
myClassName.set_title(
context=obj.context,
payload=events_sent_objs.SetTitlePayload(
title="111",
target=0,
)
)
any hint how to achieve this?
should be dict not string
Hi,
wanted to ask what is mandatory in order to connect the key_up event to some function?
and how to enable the logging?
i looked into the example, tried to do some hello world, but its not doing anything...
thnx
I would like a SAMPLE and DOCUMENT.
Can you add a document?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.