nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
638 stars 41 forks source link

Dictionary changed size during iteration #343

Closed Miguelguilherme closed 6 months ago

Miguelguilherme commented 6 months ago

For the last few days, all my shedule with "light" entities are presenting the following error: _Exception in async_timer_updated when dispatching 'scheduler_timer_updated': ('4bad81',) Traceback (most recent call last): File "/config/custom_components/scheduler/switch.py", line 251, in async_timer_updated await self._action_handler.async_queue_actions( File "/config/custom_components/scheduler/actions.py", line 260, in async_queue_actions for queue in self.queues.values(): RuntimeError: dictionary changed size during iteration

Also detected that, if they have multiple entities, will only control the first entity to be called.

(have a couple of "cover" entities and they present no errors)

Nodezero1 commented 6 months ago

Hello, Same problem since updating to 2024.4 beta.

Miguelguilherme commented 6 months ago

that's it! I'm also on beta channel.

just updated to 2024.4.0b4 and the problem persists. will also report to HA

Miguelguilherme commented 6 months ago

HA answer: This is an issue in the scheduler custom integration. Please report it at their issue tracker.

VDRainer commented 6 months ago

I see different errors. On changing a schedule for climate target temperature:

2024-04-02 19:47:00.483 ERROR (MainThread) [homeassistant.util.logging] Exception in async_timer_updated when dispatching 'scheduler_timer_updated': ('8ca26b',)
Traceback (most recent call last):
  File "/home/homeassi/.homeassistant/custom_components/scheduler/switch.py", line 251, in async_timer_updated
    await self._action_handler.async_queue_actions(
  File "/home/homeassi/.homeassistant/custom_components/scheduler/actions.py", line 260, in async_queue_actions
    for queue in self._queues.values():
RuntimeError: dictionary changed size during iteration

When the schedule fires:

2024-04-02 19:50:00.011 ERROR (MainThread) [homeassistant.util.logging] Exception in async_timer_finished when dispatching 'scheduler_timer_finished': ('8ca26b',)
Traceback (most recent call last):
  File "/home/homeassi/.homeassistant/custom_components/scheduler/switch.py", line 278, in async_timer_finished
    await self._action_handler.async_queue_actions(
  File "/home/homeassi/.homeassistant/custom_components/scheduler/actions.py", line 260, in async_queue_actions
    for queue in self._queues.values():
RuntimeError: dictionary changed size during iteration

The schedule seems to work, target temperature gets changed.

nielsfaber commented 6 months ago

I just made release v3.3.3 that should fix this error message.

Miguelguilherme commented 6 months ago

fixed! many thanks!