hankhank10 / music-screen-api

Display the playing Sonos track in real time on an e-ink display - also includes functionality for last.fm
120 stars 17 forks source link

Webhook updating & async support #13

Closed jjlawren closed 4 years ago

jjlawren commented 4 years ago

Sorry, this is a large potential PR. It has several changes that were somewhat dependent on each other:

I've really only tested for my own use-cases. I'd appreciate if you'd give this branch a try and provide any feedback.

PS: I'm not super happy about using tkinter in an async context, but it's a non-interactive UI and I haven't run into any actual problems.

jjlawren commented 4 years ago

Changed the logic so webhooks will be automatically used if properly configured in node-sonos-http-api (i.e., no config option in this script necessary). If no webhooks are received for some time when we're expecting them, it will fall back to polling.

jjlawren commented 4 years ago

This should be ready for testing. It works quite reliably for me. I have one small followup PR to improve the image grabbing, but I'll keep that part separate.

The demaster.py and scrap.py dependencies still use requests which isn't ideal, but those appear to live in different repos. They work as-is, but it would be best to also convert those to async.

jjlawren commented 4 years ago

One small logical error I'd like to fix first. Once that's done would it be reasonable to merge into the dev branch and ask users for additional testing?

jjlawren commented 4 years ago

Fixed and tested, I'm happy with this now.

I don't have a Zero to test with, but I'd imagine it would be able to handle the load relatively well as long as node-sonos-http-api is configured to sent webhook updates.

hankhank10 commented 4 years ago

Good work. Go ahead and push as dev branch.

On Mon, 13 Jul 2020 at 19:45 jjlawren notifications@github.com wrote:

Fixed and tested, I'm happy with this now.

I don't have a Zero to test with, but I'd imagine it would be able to handle the load relatively well as long as node-sonos-http-api is configured to sent webhook updates.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hankhank10/music-screen-api/pull/13#issuecomment-657727775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVMWJPCBUNNXGFXVCBUXLR3NI43ANCNFSM4OW25TRQ .