Prevent runtime issue during entity registration in coordinator of AVM Fritz!Tools (#108667)
prevent dictionary changed size during iterationpull/108670/head
parent
80207835d7
commit
3d1751bdfa
|
@ -315,12 +315,14 @@ class FritzBoxTools(
|
|||
}
|
||||
try:
|
||||
await self.async_scan_devices()
|
||||
for key, update_fn in self._entity_update_functions.items():
|
||||
for key in list(self._entity_update_functions):
|
||||
_LOGGER.debug("update entity %s", key)
|
||||
entity_data["entity_states"][
|
||||
key
|
||||
] = await self.hass.async_add_executor_job(
|
||||
update_fn, self.fritz_status, self.data["entity_states"].get(key)
|
||||
self._entity_update_functions[key],
|
||||
self.fritz_status,
|
||||
self.data["entity_states"].get(key),
|
||||
)
|
||||
if self.has_call_deflections:
|
||||
entity_data[
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.fritz.const import DOMAIN
|
||||
from homeassistant.components.update import DOMAIN as UPDATE_DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
|
@ -49,7 +47,6 @@ async def test_update_entities_initialized(
|
|||
assert len(updates) == 1
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="Flaky test")
|
||||
async def test_update_available(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
|
|
Loading…
Reference in New Issue