chapnickc / WizHook

Synchronize your Wiz connected light with the music you play on Spotify
MIT License
18 stars 2 forks source link

Only One Spotify Account Available #1

Closed Unknown303YT closed 1 year ago

Unknown303YT commented 1 year ago

Hi @chapnickc

I noticed there is only one Spotify account available for this project. Is there a way you could configure this so multiple Spotify accounts could use the app?

Thanks, Aidan R

chapnickc commented 1 year ago

@AidanR8459,

Thank you for the inquiry--support for this has been added, theoretically.

Presumably the objective is to control different sets of lights using unique inputs from different Spotify accounts. The idea is then to instantiate a SpotifyChangeListener and LightController for each Spotify account, then process events using the existing asyncio event loop. These changes can be made in main.py.

In the first invocation, you may be required to perform the authentication step for each account.

An MIT license has been added to the project so feel free to fork and get funky!

Unknown303YT commented 1 year ago

Thank you @chapnickc!

Unknown303YT commented 2 months ago

Hello!

After a while I have come back to look at the project and I am working on a script to allow as many spotify accounts as you want. Once I am done, I will likely make a fork of the project with the code. Just wanted to give an update!

chapnickc commented 2 months ago

Excellent @Unknown303YT, persistence is key! Glad to hear you've identified the vision you want to achieve with this project. Will be neat to see what you come up with (e.g. if you can select the desired Spotify account per session).

It's a great base to start with, hooking into Spotify events and features api—adding liveliness to the base Wiz light functionality. It may be worth exploring other ways to render colors, this cycle approach is very exploratory and somewhat rudimentary.

Feel free to share the changes once stable to help inspire others!

Unknown303YT commented 2 months ago

The concept I have come up with uses a cache that stores a display name and a spotify username, and then just requests you to select or add an account when you load the program, and depending on what account you choose it sets the respective spotify info. Then you just add the accounts to the spotify developer account.