taburineagle / NeewerLite-Python

NeewerLite-Python is an un-official cross-platform Neewer LED light control app - written in Python, originally based off of the NeewerLite macOS Swift project by @keefo (Xu Lian)
MIT License
63 stars 11 forks source link

Keyboard shortcuts? #3

Closed ec1cw closed 2 years ago

ec1cw commented 3 years ago

I tried it on Windows and got it to work. Well done! I wonder if you considered the possibility of keyboard shortcuts for certain actions.

taburineagle commented 3 years ago

Thank you! That should be doable as a feature request, what kind of keyboard shortcuts are you looking for? Like CTRL-1/2/3 for selecting CCT/HSI/ANM mode, or something more specific?

ec1cw commented 3 years ago

I was thinking of user-configurable combinations like the Hotkeys in the Settings section of OBS Studio, where you can configure your own key combinations for different actions. Besides selecting the modes, turning the light on and off, and possibly increasing/decreasing parameters such as color temperature, brightness, hue, saturation.

fribse commented 3 years ago

That would be great, I would love to have the controls in my streamdeck as well, but I think that should be doable by simply using the CLI, right? Btw. I have two new lights coming in, one 440 RGB and one more 660 white temperature. Interesting to see if it works with the 440 RGB, should be the same as the 660 RGB :-)

taburineagle commented 3 years ago

Got you - @ec1cw - that should be doable, although making custom keybindings might take a little more time...

@fribse - Awesome! That should work the same way as the RGB-660, or at least I hope it does :) Yep! The CLI will do that, so will the HTTP server - with the cli, it links and sends one command to one light at a time (so far) - so

--cli --light=(mac address) --mode=CCT --temp=5200 --bri=60

would send the command to 1 light. The HTTP server keeps connections to the lights alive, so they're a lot more accessible (a lot more like the GUI program, it's just running waiting for commands) - so you'd run the program with the parameter --http, then access the HTTP server from 127.0.0.1:8080 (from the computer serving it), or 192.168.0.xx (from another PC on the same network) then use commands sent to the server to control the lights. So a demo command for the http interface would look like

http://127.0.0.1:8080/NeewerLite-Python/light=1;2;3;4|mode=CCT|temp=5200|bri=60

And that would send the same command to the lights 1, 2, 3 and 4 at the same time. Ha, I seriously need to write the manual for everything, but haven't had a chance to yet!

taburineagle commented 2 years ago

@ec1cw - I've looked into this a bit over the past few days, and while it's doable, it would require another Python library to do (the keyboard library), so it would require another dependency to work.

ec1cw commented 2 years ago

@taburineagle I don't think it's critical, and it should not be a priority at this point. As the colleagues have mentioned, a similar functionality can be achieved with the http server. Taking about libraries, I think it should be helpful to list all the dependencies in the project's presentation. Keep up the good work!

taburineagle commented 2 years ago

True, true - thank you! 😊 I've started working on a manual for the whole NeewerLite-Python project, it's a work in progress, but does document which dependencies are needed for which modes. At the moment, there are just 2 outside dependencies - bleak and PySide2 - the only required dependency is bleak, because that's the system that actually does the Bluetooth communication with the lights. PySide2 is also needed, but only if you're using the GUI - neither the CLI or HTTP server need it, so if you're doing a more simple setup (like a Raspberry Pi CLI based system), all you need is bleak.

taburineagle commented 2 years ago

Hello @ec1cw - I'm closing this issue for now, not as a wont-fix, but will open it again later when/if I get a chance to implement the keyboard shortcuts. I'm working on reading power state/channel/etc. from the light now.

taburineagle commented 2 years ago

Ha, @ec1cw - I'm actually reopening this, as I found a way with PySide2 (the GUI constructor) to do this natively without another dependency - it might still be a hot minute or two before I'm able to implement it, but it's not as out-of-the-box as I first thought :)

taburineagle commented 2 years ago

image

taburineagle commented 2 years ago

OK, @ec1cw - I've added them - the commit lists which ones are available, but I'll post them here too -

CTRL-PAGE UP - turn selected light(s) on CTRL-PAGE DOWN - turn selected light(s) off CTRL-SHIFT-S - Scan/Re-scan CTRL-SHIFT-C - Link to the selected light(s) ALT-1 - Switch to CCT mode ALT-2 - Switch to HSI mode ALT-3 - Switch to SCENE mode ALT-4 - Switch to Prefs

Brightness (regardless of which tab you're currently on - unless you're on the Prefs tab) - / - Decrease the brightness by a small amount CTRL-/ - Same as above, but by a larger amount * - Increase the brightness by a small amount CTRL-* - Same as above, but by a larger amount

Moving the sliders - 7 - Decrease the first slider on a tab by a small amount CTRL-7 - Same as above, but by a larger amount 9 - Increase the first slider on a tab by a small amount CTRL-9 - Same as above, but by a larger amount 4 - Decrease the 2nd slider on a tab by a small amount CTRL-4 - Same as above, but by a larger amount 6 - Increase the 2nd slider on a tab by a small amount CTRL-6 - Same as above, but by a larger amount 1 - Decrease the 3rd slider on a tab by a small amount CTRL-1 - Same as above, but by a larger amount 3 - Increase the 3rd slider on a tab by a small amount CTRL-3 - Same as above, but by a larger amount

Also, 1-9 on the SCENE mode tab launches the animation corresponding to that number.

taburineagle commented 2 years ago

Added into the main program! Now you can set custom shortcut mapping for any of the shortcuts in the program.

taburineagle commented 2 years ago

I'm going to close this one again - all should be added @ec1cw - if you have any issues, please feel free to re-open!