Cache matching MQTT subscriptions (#41433)
This commit is contained in:
1 parent
85603dcd08
commit
392d5c673a
2 files changed
+19
-5
No files matched your search
+5
-1
@@ -384,9 +384,13 @@ async def mqtt_mock(hass, mqtt_client_mock, mqtt_config):
|
||||
assert result
|
||||
await hass.async_block_till_done()
|
||||
|
||||
# Workaround: asynctest==0.13 fails on @functools.lru_cache
|
||||
spec = dir(hass.data["mqtt"])
|
||||
spec.remove("_matching_subscriptions")
|
||||
|
||||
mqtt_component_mock = MagicMock(
|
||||
return_value=hass.data["mqtt"],
|
||||
spec_set=hass.data["mqtt"],
|
||||
spec_set=spec,
|
||||
wraps=hass.data["mqtt"],
|
||||
)
|
||||
mqtt_component_mock._mqttc = mqtt_client_mock
|
||||
|
||||
Reference in new issue
Block a user