Closed Richard-s-2020 closed 1 year ago
I am having the same issue after updating to HA 2023.6
Logger: homeassistant
Source: custom_components/circadian_lighting/switch.py:377
Integration: Circadian Lighting ([documentation](https://github.com/claytonjn/hass-circadian_lighting), [issues](https://github.com/claytonjn/hass-circadian_lighting/issues))
First occurred: 10:22:28 AM (119 occurrences)
Last logged: 10:16:53 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/circadian_lighting/switch.py", line 383, in _light_state_changed
await self._force_update_switch(lights=[entity_id])
File "/config/custom_components/circadian_lighting/switch.py", line 325, in _force_update_switch
return await self._update_switch(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/circadian_lighting/switch.py", line 322, in _update_switch
await self._adjust_lights(lights or self._lights, transition)
File "/config/custom_components/circadian_lighting/switch.py", line 377, in _adjust_lights
await asyncio.wait(tasks)
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 415, in wait
raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
I managed to fix it by editing line 377 of switch.py
from:
await asyncio.wait(tasks)
to:
await asyncio.wait(list(map(lambda t: asyncio.create_task(t), tasks)))
However, I saw there is a pull request already with a slightly different fix.
Closing as duplicate of https://github.com/claytonjn/hass-circadian_lighting/issues/227 - I hope to have the fix for this pushed out today.
I recently updated my home assistant, but I'm facing issues with the lights. Whenever I try to use them, I receive an error message. The exact error message I'm encountering is:
Failed to call service switch/turn_on. Passing coroutines is forbidden, use tasks explicitly.
my code is: circadian_lighting: switch:
I'm seeking assistance to resolve this problem so that my lights can function properly again. Thank you!