witnessmenow / spotify-api-arduino

Arduino library for integrating with the Spotify Web-API (Does not play music)
MIT License
180 stars 33 forks source link

Add way to get device Ids #13

Closed TheNitek closed 3 years ago

TheNitek commented 3 years ago

Is there an easy way to get the device ids available in my account? I couldn't find anything on this in the examples/code.

witnessmenow commented 3 years ago

There is a Spotify Endpoint for it, but It's not currently supported by this library

https://developer.spotify.com/documentation/web-api/reference/player/get-a-users-available-devices/

Updated the title of this issue to track this change

TheNitek commented 3 years ago

Thanks for the quick response. Sounds like a point to dig into this library and implement it myself :-)

witnessmenow commented 3 years ago

Ok cool! Let me know if there is anything I could help with.

I've made a change that takes a step in the direction of implementing this, I created a device Struct.

I think the slightly complicated thing about this is you don't know how many devices will be returned.

TheNitek commented 3 years ago

Awesome!

I'm thinking something like this: bool getDevices(SpotifyDevice devices[], uint8_t maxDevices); Then the user can decide on how many to expect

witnessmenow commented 3 years ago

That's a good solution!

On Wed 11 Nov 2020, 11:46 Claus Näveke, notifications@github.com wrote:

Awesome!

I'm thinking something like this: bool getDevices(Device[] devices, uint8_t maxDevices); Then the user can decide on how many to expect

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/witnessmenow/arduino-spotify-api/issues/13#issuecomment-725377833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL5PQXUZCR3ZSJXZ6VCANTSPJ2RBANCNFSM4TR2GA5A .

witnessmenow commented 3 years ago

I've added this feature to a new branch:

https://github.com/witnessmenow/arduino-spotify-api/tree/GetDeviceIds

Thanks for the PR for it, but I wanted to get the library running more stable before merging it and now its kind of different to what you originally worked from so it was as easy to recreate it