1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Use async_capture_events to avoid running in executor (#47111)

This commit is contained in:
Paulus Schoutsen
2021-02-26 13:28:52 -08:00
committed by GitHub
parent b1898cc176
commit 7c2545af6e
8 changed files with 39 additions and 51 deletions

View File

@@ -54,7 +54,7 @@ from homeassistant.util import color
from . import BASIC_CONFIG, MockConfig
from tests.common import async_mock_service
from tests.common import async_capture_events, async_mock_service
REQ_ID = "ff36a3cc-ec34-11e6-b1a0-64510650abcf"
@@ -84,8 +84,7 @@ async def test_brightness_light(hass):
assert trt.query_attributes() == {"brightness": 95}
events = []
hass.bus.async_listen(EVENT_CALL_SERVICE, events.append)
events = async_capture_events(hass, EVENT_CALL_SERVICE)
calls = async_mock_service(hass, light.DOMAIN, light.SERVICE_TURN_ON)
await trt.execute(