themayankjha / JAKYM

JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with both Spotify and Youtube playlist support and easy on memory. See README for installation instructions.
https://pypi.org/project/jakym/
GNU General Public License v3.0
84 stars 7 forks source link

Control via MQTT #18

Open evranch opened 1 year ago

evranch commented 1 year ago

Hey, I've been using JAKYM to play music around the farm via a USB FM transmitter.

To make it convenient to control from a phone, I threw together a simple Python wrapper to control it with a MQTT dashboard instead of having to SSH into the server.

https://github.com/evranch/jakym_mqtt

Wondering if you'd be interested in MQTT functionality in the main program, if so I could probably add it fairly easily and send you a PR.

themayankjha commented 1 year ago

Wow! that's a use case I would have never seen coming.

I would very happily Accept your PR as easy remote control of the program can easily translate into multiple use cases however I do think that it should be optional i.e. MQTT shouldn't always be running and should only run in case a user specifes due to its overheads.

Looking forward for your PR and Thanks for using my program !

evranch commented 1 year ago

Sounds good, I'm thinking just a command line option to supply the server location and login info if needed should probably do it. It doesn't look like you're using any persistent config file where something like that could be stored.

MQTT is incredibly lightweight (I use it to let all my IOT/embedded stuff talk to each other here) but I agree it's good design philosophy to minimize overhead. Very easy to do as well because the whole library runs in its own thread, so if no MQTT needed, don't start the thread.

I'll get on it next time I'm trapped indoors on a freezing day and send you the PR, happy to contribute. JAKYM is a great lightweight streaming player!