Coder Social home page Coder Social logo

gri-gus / streamdeck-python-sdk Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 3.0 133 KB

Library for creating Stream Deck plugins in Python.

License: Apache License 2.0

Python 100.00%
python streamdeck streamdeck-plugin streamdeck-sdk streamdecksdk streamdeck-python-sdk streamdeckpython streamdeckpythonsdk

streamdeck-python-sdk's People

Contributors

gri-gus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

streamdeck-python-sdk's Issues

access to the event loop is needed

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.

Can’t find global settings in property inspector .html

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?

How to set_title from function?

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?

Any basic critical path howto available?

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

about document

I would like a SAMPLE and DOCUMENT.
Can you add a document?

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.