Hi @postlund. Hoping to either post a new bug, or any insights into what I’m doing wrong.
My HA environment:
- HASSIO 2021.10.7
- Apple TV Beta v1.6.0
- Debug logging enabled for pyatv and custom_components.apple_tv
My Apple TV:
When I attempt to add the Apple TV integration (Configuration → Add Integration – Apple TV) I see two different behaviors:
Behavior 1:
After clicking “Add Integration”, the pop-up screen will stall on “Please wait while the integration is being set up”. What shows in logs at this point:
2021-11-02 21:22:21 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration apple_tv: cannot import name 'ATTR_CONNECTIONS' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
2021-11-02 21:22:21 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 709, in async_create_flow
integration.get_platform("config_flow")
File "/usr/src/homeassistant/homeassistant/loader.py", line 532, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 537, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/config/custom_components/apple_tv/__init__.py", line 12, in <module>
from homeassistant.const import (
ImportError: cannot import name 'ATTR_CONNECTIONS' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 151, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 169, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 716, in async_create_flow
raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler
Behavior 2:
After clicking “Add Integration” → Search for and click “Apple TV”, pop up screen shows “Config flow could not be loaded”. From the logs, one error which also was part of the first behavior:
2021-11-02 21:26:19 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration apple_tv: cannot import name 'ATTR_CONNECTIONS' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
Appreciate any thoughts on what might be happening. Thanks.