Hi,
I’ve switched from homebridge to HASS and I’m glad to see pyATV on this platform.
Works well on a docker with hass.io but got an error with a chroot with Debian Buster 10.6 + Python 3.8.6 + HASS 0.118.4:
2020-12-01 08:57:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/config_entries.py", line 136, in post
return await super().post(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/data_entry_flow.py", line 69, in post
result = await self._flow_mgr.async_init(
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 130, in async_init
result = await self._async_handle_step(
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/home/homeassistant/.homeassistant/custom_components/apple_tv/config_flow.py", line 137, in async_step_user
self.scan_result, _ = await device_scan(None, self.hass.loop)
File "/home/homeassistant/.homeassistant/custom_components/apple_tv/config_flow.py", line 76, in device_scan
scan_result = await scan(loop, hosts=hosts, timeout=timeout)
File "/srv/homeassistant/lib/python3.8/site-packages/pyatv/__init__.py", line 49, in scan
devices = (await scanner.discover(timeout)).values()
File "/srv/homeassistant/lib/python3.8/site-packages/pyatv/support/scan.py", line 205, in discover
responses = await mdns.multicast(
File "/srv/homeassistant/lib/python3.8/site-packages/pyatv/support/mdns.py", line 585, in multicast
await protocol.add_socket(net.mcast_socket(None, 5353))
File "/srv/homeassistant/lib/python3.8/site-packages/pyatv/support/net.py", line 67, in mcast_socket
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
OSError: [Errno 92] Protocol not available
Needed to patch net.py like this to get it work:
if hasattr(socket, "SO_REUSEPORT"):
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Strange.
By the way, Pierre, did you see the new AppleTV remote controller implementation on Hap-nodejs?
I’ve played with Siri commands and patched it to send recorded sentences: magic to launch an App or select TV channel!