@postlund I’ve been running the fix for a few hours now, and so far it’s working wonderfully!
I’ve switched between different apps (plex, netflix, youtube, hulu) and the component recognizes what’s playing for each. Also powered everything off, and back on, and started playing something… the component didn’t miss a beat, and updated the UI without issue.
I’d call the fix a success, and get it added! Thank you for all your hard work, it’s been a few months but I think this may have fixed it!
Will continue to test, and report back any issues I find.
Sounds good! Did you get any “400 error” in the log? If that’s not present you haven’t triggered the use case, so I want to confirm that before doing a new release.
I’ve made some changes to pyatv and implemented a real fix. This should solve re-login issues altogether and also not expose them to the user in case everything sorts itself out. I’ll see if I can make a release of it and update Home Assistant.
Thanks @postlund once it’s merged and released, I’ll get it updated and test everything out. Unless you’d like me to merge your changes now, and test everything?
Just upgraded lastnight (which included your PR), and the component has been working wonderfully ever since! I’ll update this post if anything changes, but for now I think we can finally put this to !
It never stops apparently But this looks more like an errounos request or something. Could you maybe enable some additional logging so we can see what is going on? This should be enough:
logger:
default: info
logs:
pyatv.net: debug
pyatv.daap: debug
I noticed something, and was wondering if someone else could test a theory for me?
Yesterday my component was able to connect, and worked just fine. Today, I get the typical “Establishing a connection to…” message. HA was not restarted between these two times. The only thing that changed was, the Apple TV was put to sleep in the evening, and woken up the following day.
So perhaps home-sharing (which the component requires) is disabled, and/or not re-enabled if the Apple TV is put to sleep?
Just a guess. If we can’t permanently fix the issue, hopefully we can at least narrow it down.