Apple TV not getting discovered . Syntax Error in log for asyncio.async (not supported anymore in Python 3.7)

Although based on the log HASS discovered the Apple TVs; it is unable to do something as part of the discovery. I can see the following error being generated:

2018-09-19 17:42:39 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/Users/Media/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py", line 176, in atv_discovered
CONF_START_OFF: False
  File "/Users/Media/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py", line 199, in _setup_atv
import pyatv
  File "/Users/Media/homeassistant/lib/python3.7/site-packages/pyatv/__init__.py", line 13, in <module>
from pyatv.internal.apple_tv import AppleTVInternal
  File "/Users/Media/homeassistant/lib/python3.7/site-packages/pyatv/internal/apple_tv.py", line 363
run_async = asyncio.async  # pylint: disable=no-member
                        ^
SyntaxError: invalid syntax

I did a search on asyncio.async and it looks like it is deprecated and does not work in Python 3.7 (which is what I have installed).

Hi there, I’m having the same issue here! Did you manage to solve it? Thanks!

No, from what I can gather it is an issue with this not being supported on Python 3.7.

The HASS component uses pyatv and the issue is within that module. I checked on GitHub and it looks like the owner of it has opened a pull request to fix this (https://github.com/postlund/pyatv/pull/154) but it has not yet been put into a release. Once it is in a release then the HASS component needs to be updated to use the newer version.

Thanks, after a bit of research I’ve noticed this as well. we’ll wait and see!

Any update in this one?