Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Call-service error. wait() got an unexpected keyword argument 'loop'" #504

Open
ccssuit opened this issue Apr 27, 2023 · 1 comment
Open

Comments

@ccssuit
Copy link

ccssuit commented Apr 27, 2023

homeassistant日志
此错误来自自定义集成。
Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/xiaomi_miot_raw/basic_dev_class.py:709
Integration: Xiaomi MIoT (documentation, issues)
First occurred: 2023年4月26日 18:24:27 (7 occurrences)
Last logged: 08:33:06

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: wait() got an unexpected keyword argument 'loop'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 709, in async_service_handler
yield from asyncio.wait(update_tasks, loop=self.hass.loop)
TypeError: wait() got an unexpected keyword argument 'loop'

@ccssuit
Copy link
Author

ccssuit commented Apr 27, 2023

按报错信息File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 709, in async_service_handler
yield from asyncio.wait(update_tasks, loop=self.hass.loop)
将/config/custom_components/xiaomi_miot_raw/basic_dev_class.py代码修改去掉loop=self.hass.loop,可以消除错误。
此方法有参考【调用execute_text服务,报"wait() got an unexpected keyword argument 'loop'" #468】问题的回复。

代码修改:

## yield from asyncio.wait(update_tasks, loop=self.hass.loop)
yield from asyncio.wait(update_tasks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant