Closed jjlawren closed 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.
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.
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?
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.
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 .
Sorry, this is a large potential PR. It has several changes that were somewhat dependent on each other:
node-sonos-http-api
webhooks. Instead of repeatedly polling every 500ms, this will only update in response to Sonos activity (and at least every 60 seconds just in case). This requires anode-sonos-http-api
config change to enable the outgoing webhooks.aiohttp
instead ofrequests
. New dependency that may need to be installed.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.