File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 376, in _async_set_up_integrations
*(async_setup_component(hass, domain, config) for domain in domains_to_load)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 562, in async_forward_entry_setup
result = await async_setup_component(self.hass, domain, self._hass_config)
File "/usr/src/homeassistant/homeassistant/setup.py", line 46, in async_setup_component
return await setup_tasks[domain] # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 52, in async_setup_component
return await task # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 137, in _async_setup_component
hass, config, integration
File "/usr/src/homeassistant/homeassistant/config.py", line 757, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 232, in get_platform
f"{self.pkg_path}.{platform_name}"
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/ha-cloud-music/media_player.py", line 72, in <module>
files, names = getallfile(__dirname+'\\dist')
File "/config/custom_components/ha-cloud-music/media_player.py", line 58, in getallfile
allfilelist=os.listdir(path)
一直报错
ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/zxl/homeassistant/custom_components/ha-cloud-music/media_player.py", line 164, in interval
if self.media_duration > 2 and self.media_duration - 2 <= self.media_position and self.next_count > 0:
File "/home/zxl/homeassistant/custom_components/ha-cloud-music/media_player.py", line 271, in media_duration
return self._media.attributes['media_duration']
KeyError: 'media_duration'