pyatv: Scan is broken after update?
import asyncio
import time
import pyatv #for controlling apple tv
from pyatv import conf, connect, scan #for controlling apple tv
from pyatv.const import Protocol #for getting port
async def test():
loop = asyncio.get_event_loop()
atvs = await pyatv.scan(loop, timeout=5)
print(atvs)
asyncio.run(test())
the above was working fine prior to the last update? Any idea what would have changed to break it?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (6 by maintainers)
Commits related to this issue
- mdns: Revert binding to port 5353 Seems to work better when binding to random port, so changing back. Fixes #871 — committed to postlund/pyatv by postlund 4 years ago
- mdns: Revert binding to port 5353 Seems to work better when binding to random port, so changing back. Fixes #871 — committed to postlund/pyatv by postlund 4 years ago
If I get time for it, I will revert the port change tonight. I will have to look through a few issues first, but I will try to make a release soon and bump in Home Assistant for the 1.0 release.
Did not hardcode ports. Simply did the below. On my router I setup the below addresses to be static in DHCP, so even after reboot or arp reset these devices will pick up the same addresses. Its fast, works, and runs inside its own thread updating a global if the device settings were ever to change for some reason, or the ports to shift, it would automatically update the global and the rest of the code would be aware.
I suspect this is because I changed the port I bind to from random to 5353, which I would expect should work (that what python-zeroconf seems to do). But I might have to revert that.